GUI scripting-select menu item in Mail's Styles popupbutton

Hi,
The following script complies without returning an error.
In Mail, with a new message window displayed, the Styles sheet displayed (select Format>Style>Styles...), and the Favorite Styles radio button selected, the script below returns an error when it gets to the line "click pop up button item 'Bold'" (the menu does contain an item "Bold!").
I'd prefer to select the menu item by name rather than by using keystrokes in the script because I will be adding styles to the Styles menu, which will result in changes in the numbering of items in that menu.
Could someone please explain to me how to accomplish this?
Thanks in advance!
tell application "System Events"
tell application process "Mail"
tell first window
tell first sheet
tell first radio group
tell radio button 2
click
end tell
end tell
tell pop up button 1
click
click pop up button item "Bold"
end tell
end tell
end tell
end tell
end tell

When you click the pop up button, the result is a menu, so you will need to click an item of that menu - for example:
tell pop up button 1
      click
      click menu item "Bold" of menu 1
end tell

Similar Messages

  • Why does my Desktop Mouse freeze (moves erratically) when selecting menu items in PSE13 Editor?

    It seems that my computer with 8GB of memory may not be enough to use PSE13.    The Organizer menu works fine when I select menu items.   The problem is when I switch to the Editor.   My mouse starts to freeze, move fast, or too slow.  It is difficult to select
    a menu item in this situation.

    Unusual. In theory PSE13 should be better as it's a 64 bit application.
    Can you try re-setting the prefs then close and re-launch the Editor. First you need to go to:
    Edit >> Preferences >> General
    Then click the button shown on the image below.

  • How to assign script to menu item? (JS, CS3)

    Hi All,
    I can't find out how to assign a script to a menu item. Instead of clicking a script name in the script panel, I want to appear a menu item in the menu bar. When I click that name on the menu bar I want a certain script to run.
    I've managed to put the menu item in the menu bar, but not to assign the script to it.
    many thanks
    marco

    Hi Marco,
    Here is an example:
    #targetengine "kasyan"
    var myScript1 = new File(app.filePath + "/Scripts/Scripts Panel/Preflight CS3 v3.2.jsx");
    var myScriptAction1 = app.scriptMenuActions.add("Preflight Document");
    var myEventListener1 = myScriptAction1.eventListeners.add("onInvoke", myScript1, false);
    var myScript2 = new File(app.filePath + "/Scripts/Scripts Panel/Rename Sections v3.1.jsx");
    var myScriptAction2 = app.scriptMenuActions.add("Rename Sections");
    var myEventListener2 = myScriptAction2.eventListeners.add("onInvoke", myScript2, false);
    var myScript3 = new File(app.filePath + "/Scripts/Scripts Panel/Check 100 3 SE.scpt");
    var myScriptAction3 = app.scriptMenuActions.add("Check Resolutuon of Images");
    var myEventListener3 = myScriptAction3.eventListeners.add("onInvoke", myScript3, false);
    var myScript4 = new File(app.filePath + "/Scripts/Scripts Panel/Resize Images v16.1.scpt");
    var myScriptAction4 = app.scriptMenuActions.add("Resize Images");
    var myEventListener4 = myScriptAction4.eventListeners.add("onInvoke", myScript4, false);
    try{
    var myScriptMenu = app.menus.item("$ID/Main").submenus.item("Scripts");
    myScriptMenu.title;
    catch (myError){
    var myScriptMenu = app.menus.item("$ID/Main").submenus.add("Scripts");
    var myScriptMenuItem1 = myScriptMenu.menuItems.add(myScriptAction1);
    var myScriptMenuItem3 = myScriptMenu.menuItems.add(myScriptAction3);
    var myMenuSeparator1 = myScriptMenu.menuSeparators.add();
    var myScriptMenuItem2 = myScriptMenu.menuItems.add(myScriptAction2);
    var myScriptMenuItem4 = myScriptMenu.menuItems.add(myScriptAction4);
    Kasyan

  • Javascript Select Menu Item & Tool

    I am brand new to javascript and quite overwhelmed trying to learn this language. I am trying to convert extensions for Photoshop that were created with Configurator 4 (in case some of you may not know, these panels will no longer be supported in future versions of Photoshop).
    I need to create some HTML panels that use javascript. If someone could help me get started with some basic javascript I would be greatly appreciative.
    Here is what I need to get started:
    1. Tabs at the very top for access to different panel layers.
    2. Open menu item with button connected to javascript.
    3. Select tool from javascript.
    I have found the documentation a bit scarce for non-coders (Hello Adobe), so if someone could show me how the above would work then I probably can figure out the rest.
    Thanks in Advance - Sam

    Thank you - that's the ticket.
    For both tool and menu item I had ScriptingListenerJS active and it gave me the javascript for selecting a tool and also a menu item.
    I will look into the creating tabs on the panel in html.
    Another question:
    I am working with the "Hello World" extension example and am a bit confused by the main.js file.
    (function () {
        'use strict';
        var csInterface = new CSInterface();
        // Reloads extension panel
        function reloadPanel() {
            location.reload();
        function init() {
            themeManager.init();
            $("#btn_reload").click(reloadPanel);
            $("#btn_test").click(function () {
                csInterface.evalScript('sayHello()');
            $("#new_doc").click(function () {
                csInterface.evalScript('newDoc()');
             $("#myNewDoc").click(function () {
                app.documents.add();
        init();
    On the html page there is this: <button id="btn_test">Call ExtendScript</button>
    On the main.js file there is this:
    $("#btn_test").click(function () {
                csInterface.evalScript('sayHello()');
    What does the "$" mean and what does the "#" mean in front of "btw_test".
    Thanks in advance - Sam

  • Trouble selecting menu item using AppleScript

    Now that iWork Numbers 3.2 has added the ability to hide columns and rows via the menubar, I'm trying to make it work in an Applescript using system Events and the click menu item command, but no dice.  Any ideas?
    tell application id "com.apple.iWork.Numbers"
      activate
              tell table 1 of the active sheet of document 1
                        --select the range
                        set thisRangeName to "A:B"
                        set the selection range to range thisRangeName
                        --hide the cells
                        tell application "System Events"
                                  tell application process "Numbers"
                                       --this causes an error
                                      click menu item "Hide 2 Columns" of menu 1 of menu bar item "Table" of menu bar 1
                                       --this doesn't seem to do anything
                                       click menu item 18 of menu 1 of menu bar item "Table" of menu bar 1
                                  end tell
                        end tell
              end tell
    end tell

    I finally settled on this solution:
    tell application id "com.apple.iWork.Numbers"
         activate
         tell table 1 of the active sheet of document 1
              set thisRangeName to "A:B"
              set the selection range to range thisRangeName
         end tell
    end tell
    tell application "System Events" to tell process "Numbers"
         click menu bar item "Table" of menu bar 1
         keystroke "Hi"
         delay 0.5
         keystroke return
    end tell
    I would be curious to know if anyone has found a more elegant solution.

  • IPod Touch Self Selects Menu Items Without Touching Screen - 2nd Gen

    With my iPod Touch sitting flat and motionless on a desk, without even touching it, menu items on the screen are self selecting, as if a ghost were touching the screen and selecting the item. It happens on the lower left portion of the screen on whatever screen is currently displayed. It will continue to select whatever item is in that area of the screen, advancing, or going back, until nothing is in that area of the screen to be selected. This "self Selection" happens at various times, from 1 second to a minute, from when the screen is displayed. Usually at about 5-10 second intervals, but it varies.
    Here is what I have done thus far in attempts to "fix" the problem. None of them have worked and the problem still remains.
    - Restored the iPod from within iTunes (twice)
    - Complete Reset/Erase of the Touch on the unit itself (twice)
    - Ensured the battery was fully charged
    - Synced it with two entirely separate iTunes Libraries on 2 different computers
    - Cleaned the screen VERY well to ensure that no film or residue was on it (it is squeaky clean)
    - Slightly tried to flexed (very gently) the Touch to see if it would change this from happening
    - The shake feature is not the issue (turned off and not touching the iPod Touch)
    - Searched the web pretty thoroughly for answers
    Any thoughts...?
    Message was edited by: Solution Room

    You have the "Halloween Syndrome!!"
    Good news though, it should clear up when Halloween is over with.
    Seriously, it sounds like your screen digitizer needs replacing. Contact a third-party repair service. It will be cheaper to fix that going through Apple.
    Check out the new remodeled MacOSG website! 24-hour Apple-related news & support.
     MacOSG: An Apple User Group  iTunes: MacOSG Podcast  Follow us on Twitter: MacOSG

  • Play button doesn't work -- doesn't select menu item

    By default, the first thing selected in my encore menue is a text button that says "play all".  So, you can start the DVD playing by pushing the enter button on the remote, by pushing the play button on the remote, or by pushing the play button on the dvd player.  This is as it should be; this is for my dvd (not blu-ray).
    When I burn a blu-ray (instead of a DVD), the play button on the remote and the play button on the dvd player do not work.  I can only use the enter button on the remote.
    I ran a second test by burning a very short movie clip with a simple button in encore.  Again, the results were the same--no problems for a dvd, but messed up for a blu-ray.
    I am playing the DVD and blu-ary on the same player.
    Any ideas?
    Thanks

    Hi Jim:
    The problem is not with the player, a Sony. 
    A couple of months ago I authored a DVD (Blu-ray) of a wedding anniversary the main menu of which had just a couple of buttons  --  the video (about 40 minutes) and a slideshow of a couple of hundred slides with music.   It was wedding present.  Everything worked as planned, not only on my Sony equipment but on Panasonic and LG.  Menu items highlighted as they should and could be toggled by the remote, just as things have been for years (since 1996 for me I guess.)
    The people subsequently asked for 3 extra blu-rays and 12 regular DVDs for people who had seen it but didn't have Blu-ray players.  No problem, said I.  I still have the Encore "ncor" file and plenty of blanks.
    Turns out that I must have relocated some files  --  Encore could not find the previous folder.  Fortunately the Premiere program files were intact so I simple created a new Encore project and created a new ISO file.  This time I made a couple of menu pages and created chapters as well as the slide show.  I made a DVD (on a re-writeable disc) and it worked as expected.  I cut a dozen disks and labeled them.  Meanwhile I made the blu-ray iso file (having made the required changes in Encore.)
    First got a Photoshop error code -45 (although I had not even opened Photoshop for a month.) 
    I shut down everything with the idea of starting Encore as the Administrator (a trick that has fixed other problems) and the blu-ray image file was created without a hitch.  But still got an ISO file that, when burned to a blu-ray, had buttons that would not highlight and would not work.   Also the "pause" button would not work.  (I have a long organ piece with the home menu page.)  Nor would the number buttons.  Just the "top menu" buttons on the remote.
    Obviously everything worked in preview: highlights showed on the buttons that, when pressed, went to the right files.   So everything works perfectly well in Preview and with DVD.  It is just with Blu-ray that there is a problem.  And it is with any and all players.
    The same Blu-ray can be played on a computer using the mouse.  Again, the buttons themselves do not highlight so the software remote does not function.
    Confusing............
    Any additional thoughts?
    Barrie Austin
    [email protected]
    425-392-5760/425-922-0540 (Cell)

  • How do I select multiple items to paste a style?

    There are times when I have several paragraphs of text with a number or letter in front of strategic sections.  I like to change the color of these letters or numbers, make them boldface and change them to SuperScript.  Once I have the first one changed, in Pages 4, I would simply copy the character style for this changed letter or number.  Next, I would hold down the COMMAND key while double-clicking each subsequent letter or number.  Finally, I would paste the formatting which would update all the various items I had selected with the saved formatting.
    In Pages 5, I can copy the character style, and then hold down the COMMAND key and start double-clicking text items to reformat, but while the first item will highlight when selected, the second item I double click will highlight and the first one will de-select.
    Is there a way to multi-select text items in this way?
    Thanks for your help!!!
    Ron

    There isn't any multi- selection in Pages 5. use PAges  09 instead.

  • Applescript GUI scripting, selecting a window element

    HI everyone,
    I have an issue where I need to programmtically generate a list of Activation Requests for the ColorEyes Display Pro application. In order to get the info I need, I have to launch the app while holding the command and shift keys, then select from a drop down list. The information does present as a field that I can select and copy, but I can't figure out how to simulate a click on that field.
    I have every piece of this together except what UI element I need to access and how to select it so I can save it in a varialbe or at least copy and paste it.
    I’m only interested in the request number item of Show Field Data. Here is the code I’ve written so far:
    tell application "System Events"
        key down command
       key down shift
       do shell script "open '/Applications/ColorEyes Display Pro/ColorEyes Display Pro.app'"
        delay 10
        key up command
       key up shift
       tell process "QuickLicenseRT"
            delay 3
            click pop up button 1 of window "License Options"
            key code 125 -- down arrow key
           key code 125 -- down arrow key
           keystroke return
           delay 1
            click UI element 33 of window "License Options" --- this doesn't seem to be right. Don't know what it would be
            --delay 1
           --keystroke return
           --delay 1
           --keystroke return
       end tell
    end tell
    and the events I get when running the code:
    tell application "System Events"
       key down command
       key down shift
       do shell script "open '/Applications/ColorEyes Display Pro/ColorEyes Display Pro.app'"
           --> error number -10004
    end tell
    tell current application
       do shell script "open '/Applications/ColorEyes Display Pro/ColorEyes Display Pro.app'"
           --> ""
    end tell
    tell application "System Events"
       key up command
       key up shift
       click pop up button 1 of window "License Options" of process "QuickLicenseRT"
           --> pop up button 1 of window "License Options" of application process "QuickLicenseRT"
       key code 125
       key code 125
       keystroke "
       click UI element 33 of window "License Options" of process "QuickLicenseRT"
           --> missing value
    end tell
    Result:
    missing value
    The script runs and opens color eyes and gets to the show field data window and selects it. I can see the request number, but cant get that data into a variable.
    This is what a short applescript I found to list the elements of a given window says about this QuickLicenseRT window:
    I also have screen shots of what the QuickLicenseRT window looks like:
    The request number is different on each Mac, and I need to know which ones are active and which aren't. These activations are distributed globally so I HAVE to be able to do this programmatically.
    Any ideas?
    TIA!
    Andrew

    I can't answer directly, but there are numerous other reports of text fields not 'sticking' via UI scripting (not just in WGM).
    If it's not too late, I wouldn't recommend using UI scripting for such a large task. There are too many variables that could mess it up.
    If you haven't run the import yet I'd recommend taking a look at dscl, the Directory Service Command Line tool - it lets you manipulate any data in your directory via a command line interface. It should be more robust than UI scripting when dealing with mass updates like this.

  • Can you add audio tracks as selectable menu items on a dvd? I shot a wedding where the church had its own set up to record audio. I'm trying to make those songs performed by the artists available for viewers of the dvd to select for listening.?

    I'm trying to make audio (MP3) tracks available for viewers of this Wedding dvd to select for listening. Is this possible in iDVD?

    You will need to create a slide show for each of those songs with a minimum of 1 photo per slideshow and add the song to the slideshow audio bin. Set the audio to Fit to Music.
    In your top/main menu add a submenu for the list of songs.
    Add a slideshow for each song with the "+" button at the bottom:
    Select the link in the menu and rename it for the song used in the slideshow.  You can create a slide image for each song with the song name, composer, singer, etc. on the image to be used for the slideshow  An image editor or Pages can be used for that and then convert to a jpeg file for use in iDVD.
    The song/playlist menu could look like this depending on the theme you choose:
    OT

  • Can't select menu items in top 25% of the browser window much of the time.

    Running Windows 7 Pro on a new (2-months) HP Ultrabook with FF 15.0.1. Many times, selectable items do not work, but generally in the top 20-30% of the browser window. With the pointer hovering over selections, it does not change to indicate is a selectable item, nor will it let you select. It happens on well-known websites such as Yahoo!, HP, etc. It doesn't do this all the time, but I'd say at least 50% of the time, even if you reload the page and allow all sites with NoScript. There is no filtering warning.

    That problem can be caused by an extension like the Yahoo! Toolbar or a Babylon extension that extents too much downwards and covers the top part of the browser window and thus makes links and buttons in that part of the screen not clickable.
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode

  • Anyone have problems selecting menu items?

    Sometimes the phone will "freeze" when trying to select a contact (for example). It does allow you to go back to the home page though. Just can't select the contact.
    I have 2 iPhones and the other one does not have this problem so I assume it is a defect.

    I would try resetting the iPhone in iTunes. I don't have the problem either. Try resetting than if it still occurs then take to a Apple Genius.

  • How To Get Selected Or Clicked  Menu Item Name Or ID

    Hello.
    My Question is
    Is There Any Event In Form By Which I am able to get Clicked or Selected Menue Item's Name Or ID.
    Thanx.
    Shahzad Hafeez.

    You can use cell variant  for your requirement . Go through the below link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0310fd2-f40d-2a10-b288-bcbe0810a961
    Regards,
    Nethaji

  • Only getting context menus- can't select an item?

    I spilled some tea on my Macbook Pro key board- cleaned it up and dried it out. Now whenever I try to select an item (mac mail, numbers, finder) only get a context menu.  Can't select an item or type.  Mac mail can only look at one of my mail boxes can select and open an email but can't reply because never reach body of email because of menu opening for that item.
    Sorry, if not clear enough with descriptions- any help would be great.
    Thank you!

    It sounds as if you've encountered hardware damage due to your liquid spill. The only thing that you can do at this point is to take the machine into your local Apple Store or an AASP and have them diagnose the extent of the damage and give you an estimate for repair.
    Good luck,
    Clinton

  • How can i change 'selected menu link' color in af:menuTree

    Hi,
    Is there any selector specifically for highlighting the currently selected menu item in
    the af:menuTree.
    Right now in my skin it is taking the style of .AFDarkForeground:alias.
    I want my selected link to have different color other than AFDarkForeground:alias is having.
    Thanks,
    Sanjaykar

    Hi Frank,
    No it is not working..the style does not change..
    Any other selectors??
    Thanks,
    Sanjaykar

Maybe you are looking for