{Let me preface this by saying that I don't know jack about
AppleScript. I've been googling around (and even checked the manual)
and can't find anything like this, so I'm guessing it's so basic no
one thinks anyone has to be told how to do this.}
Problem: I want to open the front-most file in BBEdit in another
application by pressing some keyboard command.
Let's say the other application is TextEdit, but it could be any
application.
On page 322 of the manual (see, I read it :-) it says:
> Although BBEdit still supports the “active document” property, this is no
> longer necessary. Instead, if a text window is frontmost:
>
> document 1 of application "BBEdit"
> document 1 of text window 1 of application "BBEdit"
> active document of text window 1 of application "BBEdit"
>
> now all refer to the same document.
So, cobbling together that with other stuff from around the web (lots
of which is old and confusing)
I tried this:
tell application "BBEdit"
set thefile to document 1 of application "BBEdit"
set thepath to POSIX path of thefile
end tell
do shell script "open -e " & thepath
I also tried it without the tell / end tell lines
But I always get an error such as this:
https://skitch.com/luomat/f8had/bbedit-as-error
"BBEdit got an error: Can't make POSIX path of text document into type
POSIX path of text document 1."
which tells me absolutely nothing helpful.
Can someone:
1. point me in the right direction?
2. recommend a good "AppleScript for beginners" book?
--
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>