Tell application "System Events" to tell process theApp to tell menu bar 1 My select_Menu("Numbers", 5, 16) (* Insert > FileName *) Useful to get the indexs of the triggered item Tell application "System Events" to tell process theApp to tell menu bar 1 to tell menu bar item mt to tell menu 1 to tell menu item mi to tell menu 1 to click menu item ms Tell application "System Events" to tell process theApp to tell menu bar 1 to tell menu bar item mt to tell menu 1 to click menu item mi The short versions are those used in the final script. The long versions are useful to check the menu structure. Maybe you will be interested by the handlers which I use to trigger menu items thru GUIscripting. Sorry if I seem to be winging-it, I go long gaps between having to do this sort of thing. In other words hunt it down in reverse by seeing what InDesign returns from being probed for what is available. Or get every action of menu 1 of menu item "New" of menu 1 of menu bar item "File" of menu bar 1 One thing UIB reminded me of, have you tried to query what UI scripting can see? get every attribute of menu 1 of menu item 1 of menu 1 of menu bar item 3 of menu bar 1 So in theory yours is “menu item 5” or it’s name. Or menu 1 of menu item 1 of menu 1 of menu bar item 3 of menu bar 1 I’d be curious how UI Browser “sees” this item and if the various multitude of ways to access the File–>New make any difference.įor Reference, the “Book” item is: menu item "Book." of menu 1 of menu item "New" of menu 1 of menu bar item "File" of menu bar 1 Lotus Notes and Adobe’s CS3 print dialogs both had pop-ups or submenus of this type and they esssentially are inaccessible because their index says one thing in the UI browser, but is actually something else (or not available or “hidden” in some fashion). Then yes, you could have hit a problem I’ve had it happen twice where what I can best describe as “dynamically-driven menu items” occurs. Thanks!Īm I correct in assuming this is a plugin that adds an additional file type under File–>New? Hopefully one of you might be able to help me sort out this issue. I’m running Snow Leopard and ScriptDebugger 4.5 and AppleScript 2.1.1 I cannot get ANYTHING in a sub-menu to execute, such as “File> New> Document” Now…oddly, I have been able to use this same structure up to the “tell menu “File”” to execute InDesign menu commands that fall directly under the main “File” menu. There is no error, and ScriptDebugger can see the target menu item and it’s properties. The rest of the script presumably runs through with no effect. I have also tried this using the "set theResult to." method in the System Events dictionaryįor me, InDesign activates as requested. I have identified the tell structure needed through ScriptDebugger, and the documentation I have seen reflects what I’m looking at, however executing the script does not have the desired effect. My best solution is to activate the panel I need to open through the System Events. The plugin is scriptable, but the particular function I need is not. I’m writing a script, part of which needs to address an InDesign CS4 plugin. I’ve lurked and prowled the site for some time and now I need to call on the power of the collective for a bit of help. Hello MacScripter and scripters at large.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |