At 17:37 -0500 30/04/2011, Fritz Anderson wrote:

...FRONT_DOC = `osascript -e 'tell application "BBEdit" to POSIX path of \(file of document 1 as string\)'`

and BBEdit hangs as the Apple Event re-enters it...

This will always happen in any application.

If you create and run this as a UNIX script:

#!/bin/bash
osascript -e 'tell app "BBEdit" to make window'

you'll get the same thing -- like an infinite loop. You can't use "osascript" in a script called from within the application that it calls. This is working back to front.

Why not get the info you want and then use this in a 'do shell script' block within the same script, something like the example below


tell front window in application "BBEdit"
  set {_name, _selection} to {its name, selection}
end tell
do shell script "perl -e '
$text = qq~" & _name & "\\n\\n" & _selection & "~;
$f = qq~/tmp/temp.txt~;
open F, qq~>$f~;
print F $text;
`open -a bbedit $f`;
'" # END

JD

--
You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to