Here is a little test - save the following foo.scpt
set accountName to system attribute "FOO"
and in Terminal do this:
export FOO="Lumière"
osascript foo.scpt
And you’ll see garbled text instead of the correct “Lumière”.
Adding “as Unicode Text” to the foo.scpt doesn’t help.
I know I can do
do shell script "echo $FOO"
to get the env var - but in practice I have half dozen variables to pass around, and the script needs to be run fairly frequently - I don’t want to start 6 shell processes in the background just to get the env variables!
Any suggestion is extremely welcome!