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


Click here to return to the 'Open new Terminal window at current Terminal directory' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Open new Terminal window at current Terminal directory
Authored by: hughescr on May 08, '03 05:51:21PM

You can shorten the script further by using the "one liner" flag ("-e") to osascript, along with better shell quoting:

osascript -e 'tell app "Terminal" to do script "cd \"'`pwd`'\""'



[ Reply to This | # ]
Open new Terminal window at current Terminal directory
Authored by: pmccann on May 08, '03 08:12:52PM

Does this eliminate the problem with non-ascii characters
mentioned above? The extra layer of quoting looks worthwhile,
but I'm getting an error: "syntax error: Expected expression but
found ?Äúwith?Äù. (-2741)" when executing the line as printed
here. Maybe another problem with backslashes being eaten upon
submission?

(For what it's worth, the one-liner versions are in the referenced
thread; the heredoc version's my favourite in that it allows for
easier quoting and lets you just cut and paste applescript
fragments from the Script Editor rather than have to use the
ugly hack of multiple -e invocations.)



[ Reply to This | # ]