Help: Execute AppleScript Action with variable

You would use:

use scripting additions
set myVar to system attribute "KMVAR_myVar"

which is faster than getvariable, BUT

is "broken" for reading international variables.

This :ghost: will come out as mojibake: 👻

The scripting page in the manual says this:

"Variables can be accessed from shell scripts via the environment variables in the form $KMVAR_Variable_Name where KMVAR_ is prefixed, and spaces are converted to underscores. AppleScripts can also access the environment variables using the system attribute command, but note that system attribute is not safe for international characters. "

Executing Scripts

A discussion with the developer can be found here.

2 Likes