How to run an external app for mac os x and windows? lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- lestroso · 2018-04-04 21:29 Hi to everybody... i'm trying to launch in this case for mac os x an external app...but without success. the program start but when i touch the buttton nothing happend..can somebody help me please?? and for windows??' best regards, Lestroso Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  unit programma; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,Process; var  AProcess:TProcess;   type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    procedure Button1Click(Sender: TObject);  private   public   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject);begin     AProcess := TProcess.Create(nil);  AProcess.Executable:='/Users/saverio/Desktop/Eject.app';end; end. ---------------------------------------------------------------------- lainz · 2018-04-04 21:51 Missing: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i AProcess.Execute;AProcess.Free; ---------------------------------------------------------------------- Phil · 2018-04-04 22:04 Quote from: lainz on April 04, 2018, 11:51:53 pmMissing: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i AProcess.Execute;AProcess.Free; No. To launch an app bundle, you execute the open command and specify the .app bundle to start. This also works for launching a browser since OpenURL doesn't work so well on macOS. Eg, https://macpgmr.github.io/MacXPlatform/WebAppOverview_3.html#ExternalB rowser But having said that about open, there is no Eject.app on macOS. However, a quick Web search turned up these possibilities: (1) Run the drutil command. https://ss64.com/osx/drutil.html (2) Use the DiscRecording framework and/or DiscRecordingUI framework. Pascal source for framework interface units is here: https://github.com/genericptr/ Note that modern Macs do not have CD readers. That's kind of old, legacy tech. ---------------------------------------------------------------------- lainz · 2018-04-05 11:09 I responded for Windows. I don't have a Mac... General usage of TProcess. ---------------------------------------------------------------------- CM630 · 2018-04-05 11:17 Some info here: http://wiki.freepascal.org/Executing_External_Programs You might find this useful: http://forum.lazarus.freepascal.org/index.php/topic,40289.0.html ---------------------------------------------------------------------- lestroso · 2018-04-05 21:54 thanks to everybody, so it's not easy to launch an external program...either for mac os x and windows10...in other languages it's only need a command....here you have to have a long program.. ok....if you have other systems...please let me know.....thanks a lot lestroso ---------------------------------------------------------------------- Manlio · 2022-02-10 04:13 Quote from: lestroso on April 05, 2018, 11:54:21 pm...in other languages it's only need a command....here you have to have a long program.. On the Mac you can launch an app with a single line, including parameters, using fpsystem. See the example below. More documentation at https://www.freepascal.org/docs-html/rtl/unix/fpsystem.html Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses Unix; fpsystem('open -a /Applications/Safari.app');