Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

ConsoleExecuteMBS(path as folderitem, arguments() as string, environment() as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Files MBS Util Plugin 13.0 Yes No Yes Yes No
Function: Executes a new application.
Notes:
Use WindowsShellExecuteMBS on Windows.

Launch GUI tools on Mac OS X using /bin/open.
Returned value is the PID of the new process.
If the execution fails you still get a PID, but this process is terminated in a few milliseconds.

arguments must have at least one member.

See also:

Some examples using this method:

Feedback, Comments & Corrections

ConsoleExecuteMBS(path as string, arguments() as string, environment() as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Files MBS Util Plugin 7.7 Yes No Yes Yes No
Function: Executes a new application.
Example:
// launch an app using open

const sShellPath="/usr/bin/open"

dim a(1) as string
dim e(-1) as string

a(0)="open" // must be the application name
a(1)="/Applications/TextEdit.app" // first parameter

print str(ConsoleExecuteMBS(sShellPath,a,e))

// Launch app binary directly:

dim aa(1) as string
dim ee(-1) as string

dim f as FolderItem

f=GetFolderItem("test.app").Child("Contents").Child("MacOS").Child("test")

aa(0)=f.ShellPath

print str(ConsoleExecuteMBS(f.ShellPath,aa,ee))
Notes:
Use WindowsShellExecuteMBS on Windows.

Launch GUI tools on Mac OS X using /bin/open.
Returned value is the PID of the new process.
If the execution fails you still get a PID, but this process is terminated in a few milliseconds.

arguments must have at least one member.

See also:

Some examples using this method:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Util Plugin.




Links
MBS Xojo PDF Plugins