I need to pass osascript this string as an argument after -e
The equalizer preset used for the demo purpose is mine. I store the preset’s name in a shell variable Preset. I’m able to assemble this string in the command line. The solution I came up with is as follows:
However, it chokes as soon as I add osascript as in
I ran this shell script as do shell script in ScriptEditor, and no matter how I bend it it compiles as
which, of course, fires up the endless torrent of complains that “this token can’t go after that identifier”. I tried to turn on -o and -t switches to xargs to start it in interactive mode and “echo” the command to stderr before it being executed (all according to the xargs manual) but stumbled into the same wall: incorrect syntax related to an out-of-place identifier.
What do I do wrong? How to pipe to osascript a string with single and double quotes preserved in the command line as the result of the previous command?
(To test, put the name of any preset between the quotes in the variable Preset).
Model: MacBook Pro
AppleScript: 2.3.2
Browser: Safari 537.86.7
Operating System: macOS 10.9