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 iOS Targets
global method Shell MBS Util Plugin 13.0 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Executes a new application.

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 WindowsProcessMBS and WindowsShellExecuteMBS (Windows only), NSTask (Mac only) and ShellMBS (cross platform).

See also:

Some examples using this global method:

ConsoleExecuteMBS(path as string, arguments() as string, environment() as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method Shell MBS Util Plugin 7.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
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))

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 WindowsProcessMBS, WindowsShellExecuteAsAdminMBS and WindowsShellExecuteMBS (Windows only), NSTask (Mac only) and ShellMBS (cross platform).

See also:

Some examples using this global method:

Blog Entries

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


The biggest plugin in space...