I am not sure why it wouldn't work under the scripting menu, you might
try adding "on run" and see if that make a difference.

example 1:

on run
        cssformat()
end run

on cssformat()
        tell application "BBEdit"
                activate
                tell application "System Events" to keystroke "+" using {command
down, shift down}
        end tell
end cssformat

since css format isn't directly scriptable the next best thing is to
access from the application menus
but the scripts get kind of long.

example 2:

on run
        cssformat()
end run

on cssformat()
        tell application "BBEdit"
                activate
                tell application "System Events"
                        tell process "BBEdit"
                                tell menu bar 1
                                        tell menu bar item "Markup"
                                                tell menu "Markup"
                                                        tell menu item "CSS"
                                                                tell menu "CSS"
                                                                        click 
menu item "Format"
                                                                end tell
                                                        end tell
                                                end tell
                                        end tell
                                end tell
                        end tell
                end tell
        end tell
end cssformat

I am not an AS expert so there might be a better way to write this,
but I believe these are the only two way access css format.

good luck

On Nov 20, 11:43 pm, Stefano <[email protected]> wrote:
> Very nice idea, thanks  : )
>
> Next I would like understand if (and how, if yes ...) "System Events"
> could directly perform a command item without this good work around.
>
> On Nov 20, 10:27 pm, heath gertsch <[email protected]> wrote:
>
>
>
>
>
>
>
> > tell application "BBEdit"
> >         activate
> >         tell application "System Events" to keystroke "1" using command down
> > end tell
>
> > This example assumes that you set the keyboard short to command 1, but
> > of course you could set it to whatever you want.

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