MacScript Function
TOC
Collapse the table of content
Expand the table of content

MacScript Function

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Executes an AppleScript script and returns a value returned by the script, if any.

Syntax

MacScript script

The script argument is a String expression. The String expression either can be a series of AppleScript commands or can specify the name of an AppleScript script or a script file.

Remarks

Multiline scripts can be created by embedding carriage-return characters (Chr(13)).

This example uses the MacScript function to open the Choose File dialog box (the Macintosh standard-file dialog). The full path of the file chosen by the user is returned. If appropriate, the path specification is preceded by the type of the file.

ThePath$ = Macscript("ChooseFile")


Show:
© 2016 Microsoft