Your script works for me with "Safari"...
tell application "Safari"
do JavaScript "document.location=document.location" in document 1
end tell
...but strangely, if I substitute "Firefox" (my default browser), the
AppleScript Editor refuses to compile it:
tell application "Firefox"
do JavaScript "document.location=document.location" in document 1
end tell
In that case, AppleScript Editor highlights the word "JavaScript" and
throws this error:
Syntax Error
Expected end of line but found identifier.
Why should it matter which browser's name is inserted? (There are
other scripts that call "Firefox" and work fine.) What does this error
mean?
On a related note...
I looked in BBEdit's scripting dictionary for anything related to
previewing, and all I found was:
preview in browser
This works -- it previews into whichever browser you last previewed in
-- Safari, Firefox, whatever. (That's the browser whose name appears
in BBEdit's Markup menu without having to go to the "Preview in >"
submenu.) What I couldn't find was any way to script a preview into
"All Running Browsers" -- which is a command in that submenu but not
(as far as I could see) in the scripting dictionary. Anybody know if
there's a way to script that?
Thanks much.
--
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>