Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSUserScriptTaskMBS class.

NSUserScriptTaskMBS.Constructor(file as folderitem, byref error as NSErrorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Tasks MBS MacExtras Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Initialize given a URL for a script file.

The returned object will be, or raises exception if the file does not appear to match any of the known types.

See also:

NSUserScriptTaskMBS.Constructor(URL as String, byref error as NSErrorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Tasks MBS MacExtras Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Initialize given a URL for a script file.

The returned object will be, or raises exception if the file does not appear to match any of the known types.

See also:

NSUserScriptTaskMBS.execute(tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Tasks MBS MacExtras Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Execute the script with no input and ignoring any result.
Example
dim file as FolderItem = SpecialFolder.Desktop.Child("Hello.scpt")
dim e as NSErrorMBS
dim n as new NSUserScriptTaskMBS(file, e)

n.execute

This and the other "execute" methods may be called at most once on any given instance. If the script completed normally, the ExecuteFinished event's "error" parameter will be nil.
Calls later ExecuteFinished event.
The tag value is passed to the executeFinished event.

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


The biggest plugin in space...