in

Quark Forums

select menu items which are submenu items?

Last post 12-01-2009 8:13 AM by Witcher. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-11-2009 10:38 AM

    • Witcher
    • Top 50 Contributor
    • Joined on 07-22-2004
    • philadelphia
    • Posts 287

    select menu items which are submenu items?

    in 6.5...

    Without using System Events,is it possible to select menu items which are submenu items?

    i.e. this works for "Print"
       select menu item 17 of menu "File"

    But if I want to select a submenu item, say menu item 1 of "Export", how would I code that?

    None of these work:
       select menu item 1 of menu "Export"
       select menu item 1 of menu "Export" of menu "File"
       select menu item 1 of menu item "Export" of menu "File"

    The Publi Script Forum
    They taught me everything

    http://publi-script.com/Forums/index.php?board=4.0
  • 11-23-2009 11:56 AM In reply to

    Re: select menu items which are submenu items?

     The following works for me:

    001   tell application "QuarkXPress Passport 6.x"
    002      activate
    003      set DocName to name of document 1
    004      tell document DocName
    005         tell me to doMenu_QX("File", "Save Page as EPS...", "")
    006      end tell
    007   end tell

    008   on doMenu_QX(This_Menu, First_Level, Second_Level)
    009      tell application "QuarkXPress Passport 6.x"
    010         try
    011            if Second_Level is "" then
    012               select menu item First_Level of menu This_Menu
    013            else
    014               select menu item Second_Level of menu item First_Level of menu This_Menu
    015            end if
    016         on error errMsg number errNum
    017            display dialog ("An error " & errNum & " has occured" & return & return & errMsg) with icon stop
    018         end try
    019      end tell
    020   end doMenu_QX

    Notes: • The line numbers included with this script are there to aid future discussions. In order to use this script, you will have to strip all of them.

    The problem I see with your command is that the "Export" menu has submenus of its own ("HTML..." and "Layout as PDF...") which for some reason do not appear in the dictionary structure.

    HTH

    Michel Lemieux
    Click here --> to visit my PUBLISHING & SCRIPTING FORUM

  • 12-01-2009 8:13 AM In reply to

    • Witcher
    • Top 50 Contributor
    • Joined on 07-22-2004
    • philadelphia
    • Posts 287

    Re: select menu items which are submenu items?

    Sorry Michel, just saw this. (I don't seem to consistently get notified when replies are made to my posts) So are you saying that you don't think selecting submenu items is possible via Applescript?
    The Publi Script Forum
    They taught me everything

    http://publi-script.com/Forums/index.php?board=4.0
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems