Scripting question:

40 views
Skip to first unread message

David Porter

unread,
Aug 16, 2012, 2:23:21 PM8/16/12
to multiad...@googlegroups.com
Can I add a menu item using a startup script? I know scripts can call menu items, and I know I can add something to the contexual menu items, but can I, say, add an item to the "File..." Menu?

Steve Mills

unread,
Aug 16, 2012, 4:22:29 PM8/16/12
to multiad...@googlegroups.com
On Aug 16, 2012, at 13:23:21, David Porter wrote:

> Can I add a menu item using a startup script? I know scripts can call menu items, and I know I can add something to the contexual menu items, but can I, say, add an item to the "File..." Menu?

Yes. There are a few ways you can do it.

1. You can add scripts to the Startup Items folder which will add the menu items to the menus. Then you also need to add scripts to the Scripts Folder that have the same names as the menu items you added. These are the scripts that actually do the work you want to do.

2. Or you can utilize the newish Menu Scripts folder I added at some point (I don't remember which version). This is much easier, because you don't have to maintain 2 scripts for each menu item. Here's a shell for you to build on:

using terms from application "MultiAd Creator Pro"
on add menu script items
return {{add after menu item:"Print…", of menu named:"File", handler name:"ThisIsTheNameOfTheHandlerYouWantToUse", name:"Test", key equivalent:{key:"\\", modifiers:{command}}}}
end add menu script items
end using terms from

on ThisIsTheNameOfTheHandlerYouWantToUse(menuPath)
tell application "MultiAd Creator Pro"
say "hi there"
end tell
end ThisIsTheNameOfTheHandlerYouWantToUse

Just fill out the needed part of this and save it to the Menu Scripts folder in Add-Ons.

--
Steve Mills
Drummer, Mac geek

Brian Dickerson

unread,
Aug 16, 2012, 4:28:05 PM8/16/12
to multiad...@googlegroups.com
Thanks for your help again Steve!


--
You received this message because you are subscribed to the "MultiAd Creator User Group" group.
To post to this group, send email to multiad...@googlegroups.com
To unsubscribe from this group, send email to
multiadcreato...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/multiadcreator?hl=en?hl=en



--
Brian
bir...@gmail.com

David Porter

unread,
Aug 20, 2012, 1:41:38 PM8/20/12
to multiad...@googlegroups.com
Cool! That's just what I was looking for. Thank you Steve!

David Porter

unread,
Aug 20, 2012, 1:50:48 PM8/20/12
to multiad...@googlegroups.com
> 2. Or you can utilize the newish Menu Scripts folder I added at some point (I don't remember which version).

BTW I checked on this: I don't have a Menu Scripts folder in 8.04, but I do have one in 8.5. Both ways are pretty straightforward, though. Thanks again.
Reply all
Reply to author
Forward
0 new messages