chris -

'using terms from application "BBEdit"'?!?? 'end postmenuselect?!? how
do you know this stuff?!?!??!?  8-)

anyway, i use the keyboard shortcut to preview in (mostly) safari...
i.e., a browser instead of bbedit.

i created the script, but it didn't work at first. i looked at it
again, and thought "ah ha... i need to change the 'if' clause to read
like the menu... i.e., 'Preview in Safari (5.1)'... which did not
work.

i went to the prefs to double-check what the keyboard shortcut thought
it was attached to, and prefs said only 'Preview'.

i changed the script name to Markup•Preview.scpt, changed the 'if'
check to look for just 'Preview', and life is fantastic.

you rock.

thank you for your help and expertise!

bruce



p.s.: i used to think that javascript was fragile voodoo, and
applescript was obscure voodoo. i still feel the same way about
applescript... when it works, it rocks... but it's the weirdest, most
inconsistent language i've even come across. i'm sure glad it makes
sense to you!





On Aug 12, 9:07 pm, Christopher Stone <[email protected]>
wrote:
> On Aug 12, 2011, at 10:08, blinde wrote:
>
> > I just don't have any room to breathe until into next week... but could 
> > really use this functionality now. if anyone can forward how i would do 
> > this in applescript, i'll take it from there... thanks.
>
> ______________________________________________________________________
>
> Hey Bruce,
>
> Script Name: Markup•Preview in BBEdit.scpt
>
> Script Path: ~/Library/Application Support/BBEdit/Menu Scripts/Markup•Preview 
> in BBEdit.scpt
>
> This should save every time you use the keyboard shortcut or select the menu 
> item.
>
> Let me know if it doesn't do what you want.
>
> Props to Rich and Patrick; the example script in the manual wasn't hard to 
> figure out.
>
> --
> Best Regards,
> Chris
>
> --------------------------------------------------------------------------- 
> ---------------------
> using terms from application "BBEdit"
>
>   on menuselect(menuName, itemName)
>     if menuName = "Markup" and itemName = "Preview in BBEdit" then
>
>       set weHandledCommand to true
>
>       try
>
>         tell document of text window 1 to save
>         set weHandledCommand to false
>
>       on error errMsg number errNum
>         set sep to "=============================="
>         set e to sep & return & "Error: " & errMsg & return & sep & return ¬
>           & "Error Number: " & errNum & return & sep
>         beep
>         display dialog e
>
>       end try
>       return weHandledCommand
>     end if
>   end menuselect
>
>   on postmenuselect(menuName, itemName)
>     -- This is called after the application has processed the command.
>   end postmenuselect
>
> end using terms from
> --------------------------------------------------------------------------- 
> ---------------------

-- 
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