On Aug 10, 2015, at 08:20, Daniel Chavez <
email@hidden> wrote:
Iām having problems with the, do shell script, command.
______________________________________________________________________
Hey Daniel,
Shane is right. There's no reason to ever to this task this way.
do shell script "osascript -e 'tell app \"Finder\" to say \"ā & Network Utilities Application Loading & "\"' > /dev/null 2> /dev/null &"
But lets look at what's functionally wrong with it.
On first inspection it has a smart-double-quote which doesn't belong (see bold, underlined text above).
Change that, and it still won't compile ā so looking a bit further we see the quoting is problematic.
This works:
set shCMD to "osascript -e 'tell app \"Finder\" to say \"Network Utilities Application Loading\"' > /dev/null 2>&1"
do shell script shCMD
But as AppleScript commands go it's seriously flawed.
`osascript` is around to allow AppleScript to be executed from the shell. There's simply no need to run an AppleScript using the shell from within the AppleScript environment.
Other shell commands that AppleScript doesn't have access like `grep` or `top` to be sure ā but not `osascript`.
To run that from the shell:
osascript -e 'say "Network Utilities Application Loading"' &
I don't see any benefit to redirecting the output (> /dev/null 2>&1) in the shell script. I think you'd run the command in the background to do any good which is what the single ampersand does in the above command.