Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Use iTerm With OnMyCommand - can't reliably mix AS and OMC' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use iTerm With OnMyCommand - can't reliably mix AS and OMC
Authored by: af3556 on Aug 07, '03 12:07:47PM

> You can also use any of OnMyCommand's objects
> (cd __OBJ_PATH__; ls -la, for instance).

Note that AS's quoting is incompatible with OMC's / the shell's, specifically AS only accepts \\, \", \r, and \t; it will fail with any other escaped character. Which means if __OBJ_PATH__ is say "a file with spaces", the script will fail when OMC's escaping is turned on as OMC will escape the spaces ("\ ") and AS will barf.

BTW, there is a security issue if users try and avoid the incompatible quoting by turning off OMC's escape mechanism. (i.e. none, as suggested in the OMC v2.5.3 docs) - no amount of quoting on the command line can protect you from all input, as OMC does a text substitution before passing to the shell. i.e.

osascript ... -e 'write text "cd __OBJ_PATH__"' ...

if the folder name is "nasty `rm -rf ..`" then you're in trouble...

[ Reply to This | # ]