How to use the script "click menu item" command on a menu item for an application that runs under another user?

Hey everyone, quick question...

I am trying to run this script:

say application "System events".

say process of "iTunes."

click on menu item "Start Station" from the menu 'Song' to menu bar item 'Song' in the menu bar 1

end say

end say



The idea behind this is to start a song selected currently playing station. I know, it's not hard to do it manually, but I want to be able to do it without having to call the iTunes app to the front. Now, this script works for my own iTunes app, but I have a second instance of iTunes connecting the second user on my computer at home (User2), with its own separate library and account and all. script I have works fine for an instance of iTunes under my user account, but I can't figure out how to specify which instance of iTunes, I'd like the script to work on.




I want to emphasize as an FYI that i use.


the shell script "connection f User2 /Applications/iTunes.app/Contents/MacOS/iTunes > & - 2 > & - &" with administrator privileges

-to open my second instance of iTunes as User2



is there a way to change the "process"iTunes"to say" something like 'process 'unix ID' say' and have the ID for each respective instance of iTunes unix?


Let me know if I do not make sense... Thanks in advance to anyone who can help






You can target a process of application using various properties of system events, for example:

tell application "System Events"
  tell first item of (get application processes whose unix id is 15174) -- or whatever id
    activate --> needed when using GUI scripting
    get properties
  end tell
end tell

Tags: Mac OS & System Software

Similar Questions

  • I was on facebook and remove an icon by using the right-click menu, but then all my photos and pictures of profile, could no longer be seen. I was able to view them in the browser, so it's something I've done in Firefox. How can I unlock a site? "

    I was on facebook and remove an icon by using the right-click menu, but then all my photos and pictures of profile, could no longer be seen. I was able to view them in the browser, so it's something I've done in Firefox. How can I unlock a site?

    If you select that right click menu context then you block all images from this area and not a specific image, so do not use that.

    • Check exceptions in tools > Options > content: Load Images > Exceptions (for example sphotos.ak.fbcdn.net)

    You can use the following steps to check if the images are blocked:

    • Click on the "More information" button to open the "Page Info" with the Security tab selected (also accessible via "tools > Page Info").
    • Go to the Media of the window tab "tools > Page Info.
    • Select the first link of the image and scroll down through the list with the arrow down.
    • If an image in the list is grayed out and there is a check mark in the box "block Images of..." and remove this mark to unlock the images from this area.
  • How to use the Script TCL EEM in router?

    Dear all,

    I have a TCl Script (it's 1 to test and understand).

    ********************************************** TEST.tcl *******************************************

    : model cisco::eem:event_register_syslog "Interface FastEthernet0/0, changed State to.

    import namespace: cisco::eem: *.
    import namespace: cisco::lib: *.

    Table game arr_einfo [event_reqinfo]

    action_script enable status

    If {[catch result {cli_exec $cli_fd (fd) 'enable'}]} {error $result $errorInfo}

    If {[catch result {cli_exec $cli_fd (fd) 'int fa0/1'}]} {error $result $errorInfo}

    If {[catch result {cli_exec $cli_fd (fd) 'shut'}]} {error $result $errorInfo}

    action_syslog msg "New Port is now"

    If {[catch result {cli_close $cli_fd (fd) $cli_fd (tty_id)}]} {error $result $errorInfo}

    ********************************************** TEST.tcl *******************************************

    Can someone tell me how to use this script in router that will be used every time my interface fa0/0 he'll fa0/1 in stop mode?

    Can you give me the steps to follow in the router?

    Wharton are the sine qua non for the use of this?

    Concerning

    Concerning

    Virtually any command, Yes.  You can't do "?" as you can from an interactive session, but you can run all the commands EXEC and config otherwise.

  • How to disable the right click menu of office options in windows 7 64 bit PC?

    On right-clicking on the icon/file on the desktop, we get several options such as open, open with, cut, copy, delete, rename, scan with etc.; There's also the uninstalled software options - such as video to convert. Scan with NPAV. I want to know how to remove these options because they are redundant. For example I have uninstalled the antivirus NPAV software and replaced by MS essentials but the right click shows the two options of scan with MS essentials and NPAV. In the same way convert video option does not work as I uninstalled the trial version of the software that was pre-existing when I got the PC.

    So, how to remove these redundant click on options on the right.
    Windows 7 64-bit PC - system
    Image attached-
    Or download ShellExView
    Download ShellExView for x 64
    Organize items by Type and then highlight the type of context Menu items
    delete the ones you want
  • How to use the script to display the number of columns contain no data

    I have a requirement. There is a source that is the excel, the excel file file, we need to load data into the staging table. There are 5 columns mandatory ones must not be null. We used "No. Data Check" for this. The logic is so mentioned previously mentioned 5 columns don't contain any record that the record will be moved to without data. So far, it is fine. Now the requirement is to show what column or columns contain no data. We used a script to do this like:

    RES =' '

    RES = input1 [0] + ": failed because values null in required columns;"

    INPUT1 [1] = res;

    Output 1 = res;

    But it shows message "down because of nulls in the required columns", which is a generic message. We must show what column or columns does not contain the value "failed because of null values in a column required columnA, columnB or columnC. Can someone help me in this regard. Any kind of help is appreciated.

    You can use the variable inputname1, which keeps an array of names of the entry for the script processor attribute. For example:

    var result = "";

    var first = true;

    for (i = 1; i< input1.length;="" i++)="">

    If (input1 [i] == null | input1 [i] == ' ') {}

    If {(first)

    Firstly = false;

    } else {}

    result += "";

    }

    lead inputname1 += [i];

    }

    }

    If (result.length > 0) {}

    result = "failed due to null values in the following mandatory columns:"+ result; "

    }

    Output 1 = result;

    Kind regards

    Nick

  • Is it possible to configure the same user for 500 systems that run under XP & Win7?

    Hello

    About 500 systems are run under Windows XP & Windows7, is it possible to use the same user for all 500 systems?

    Hi SupportRI,

    Windows Live family safety is no longer manages the accounts of children using Windows Live ID Windows Live ID on behalf of the child is essentially used for the feature of managing contacts (restrictions on the use of Hotmail and Messenger). Currently, parental control can manage Windows users; However, if you have already configured a Windows Live ID account before the update, it will be always available. You can see the thread below for more information.

    Where is the function of the safety Contact family management?

    If you intend to use Windows Live Family Safety for all users of 500 to restrict the Internet connection, please note that parental control does not restrict the Internet and Web sites. You also have the option in the list of content filtering Web to apply the rules to all users under the Family Safety.

    For more information on how you can install Windows Live Family Safety, please visit the link below.

    Protect your kids with parental controls

    Thank you!

  • How to choose the maximum number of items for DMA FIFO to the R series FPGA

    Greetings!

    I'm working on a project with card PCIe-7842R-R series FPGA of NOR. I use to achieve the fast data transfer target-to-host DMA FIFO. And to minimize overhead costs, I would make the size of the FIFO as large as possible. According to the manual, 7842R a 1728 KB (216KO) integrated block of RAM, 108 000 I16 FIFOs items available in theory (1 728 000 / 16). However the FPGA had compilation error when I asked this amount of items. I checked the manual and searched online but could not find the reason. Can someone please explain? And in general, what is the maximum size of the FIFO given the size of the block of RAM?

    Thank you!

    Hey iron_curtain,

    You are right that the movement of large blocks of data can lead to a more efficient use of the bus, but it certainly isn't the most important factor here. Assuming of course that the FIFO on the FPGA is large enough to avoid overflowing, I expect the dominant factor to the size of reading on the host. In general, larger and reads as follows on the host drive to improve throughput, up to the speed of the bus. This is because as FIFO. Read is a relatively expensive operation software, so it is advantageous to fewer calls for the same amount of data.

    Note that your call to the FIFO. Read the largest host buffer should be. Depending on your application, you may be several times larger than the size of reading. You can set the size of the buffer with the FIFO. Configure the node.

    http://zone.NI.com/reference/en-XX/help/371599H-01/lvfpgaconcepts/fpga_dma_how_it_works/ explains the different buffers involved. It is important to note that the DMA engine moves data asynchronously read/write on the host nodes and FPGAs.

    Let me know if you have any questions about all of this.

    Sebastian

  • Illustrator CC 17.1 crushing on the new file or open the file (Win 7) runs under another user?

    What happens here? Works great under a different username?

    Have you tried re-install-no luck

    Tried to remove preferences in AppData - no luck

    Tried to clear the cache of fonts with CCleaner - no luck

    Removed Wacom drivers - no luck

    I have no third-party plugins?

    Would appreciate any help.

    Thank you.

    Solved the problem!

    Really weird, I had set my default printer to a commune in our home network attached to a Mac Pro (using Hello Print Services)
    I set the default back to normal and everything works fine now.

    I hope this helps someone at - it similar problems - so glad to have AI works again but do not know how I print over the network... doh!

  • Disable the right click Menu of the WebBrowser

    Hi all

    I use a WebBrowser control to display a Test report in XML format.  The problem I have is that right-clicking on WebBrowser displays a context menu.  Anyone know how to remove the right click menu option?  If not does anyone know a method to display XML files using an indicator that does not include a right click menu?

    I've tried to filter the clicks right on WebBrowser, as shown, but this seems to need the delay of 500ms (?) to work on my machine of dev of LV and is not reliable when my application is integrated in an EXE and deployed in a LV Run Time System.

    Concerning

    Steve

    Hi SercoSteveB,

    Because the WebBrowser of LabVIEW control uses Internet Explorer. The best way to disable the contextual framework

    menu is disable in fact from the Internet Explorer itself. I think that your default browser is not Internet Explorer,

    It is therefore prudent to disable right click here.

    Here is the manual that explains how do:

    Activate or deactivate the contextual menus right click in Windows Explorer

    http://www.thewindowsclub.com/enable-disable-right-click-context-menus-Windows-Explorer

    I hope that helps!

    Kind regards

  • How to disable contextual right click menu items.

    Hello

    I am disable some menu items when opening my pdf application.  However, the same menu items are enabled in right click menu popup pop up anywhere in the document.  Can someone let me know how to disable the specific menu items in the right click menu? Also, is there is it possible to disable the whole right click menu shit back in my Pdf?

    Yes, if you know the names of the menus AND they are beyond the real "arise", then you can indeed use them the same way.

  • How can I change the "right click" menu for a table control?

    Hello

    How can I change the "right-click menu" of a table control. I would like to be able to remove the ability to add or remove columns and maybe more selections. I want to keep the possibility of

    Add or remove lines

    Right-click on your table.  Then go to advanced-> DURATION Shortcut Menu-> Edit.

  • How can I change the appearance of the right click Menu

    I am running: Windows 7 Home Premium 64 Bit

    I was messing around in the control panel and I changed a setting that has changed the right click menu and how it comes on the screen. Now when I right click on it slide in but before she fainted at now I cannot change back and can not find the option for her

    I think this is where the control panel: System and security-> system: System Settings Advanced-> then watch while Visual effects.

  • How to use the @accum function in the calculation script

    Dear all.

    I'm new in essbase - calculation script so don't know how to use the @accum function.

    I want the aggregation value of child to parent

    Hierarchy

    Product

    100 > Storage Dimensions marked as stored (marked as intentionally as I want to calculate the value using the calculation script)

    100. 10 (+)

    100-20 (+)

    100-30 (+)

    I'm trying calculation Script

    100 = @Accum (@children("100"), jan: Feb);

    It works when I use below

    100 = @Accum("100-10",Jan:Feb);

    Error:-number of Dimensions [1] does not match number of gen/lev [3] office [@Dim]

    Don't know how I can roll up to an aggregate value of all the members of the child to the parent.

    Error.PNGhierachy.PNG

    you do this more difficult it must be. If you want to accumulate up to 100 then you could just make your calc

    '100 '.

    but that would be only 100, to make the OU any dimension would

    AGG (Product);

    Or better yet

    AGG (Product, Market);

  • How to use between operator in Disqualification without using the script processor?

    Hello Experts,

    How to use between operator in Disqualification? for example phonenumberLength between 7 and 10. I don't want to use the script processor? Also how to reproduce the SWITCH statement Disqualification CASE?

    Thank you

    Konate

    1 Add a processor 'check the length.

    2. connect the transformer and open the configuration dialog box

    3. in the tab 'Attributes' select your attribute of telephone number as the "field Check.

    4. in the tab "Options", enter "7-15"in the option 'number of valid characters.

    5. run the process.

    a. accounts with [included] a character length 7-15 phone numbers out of the release of "valid".

    b. records with a length of character <7 or="">15 phone numbers out of the release of "Invalid character count.

    Note: the processor also adds a 'LengthValid' flag attribute which you may also branch on [with the values "Y" and "NC" for both scenarios above]. See Library of processor of the online help for more information.

    Thank you

    Nick

  • How can I set the option of working "press quality" to create a PDF file by using the right click?

    I need to process a large volume of PDF from Word files.

    Option of work required is high quality press.

    I tested the creation of PDFs in 2 ways:

    Open the file in Word and PDF/Print/File and select high quality default press + save as default printer

    Then I tested it by selecting several files to a directory and using the right click (convert to PDF)

    Results: PDF do not have the same properties and right click PDF files have a poorer quality unsuitable for printing paper.

    Do you know how to set the option of high quality for the click press right (Adobe does not use the same parameters depending on the operation)?

    Go to the preferences of Acrobat. Choose the convert to PDF pane and click Microsoft Office Word. Click on change settings and from there, you get a dialog box that allows you to set the Settings Adobe PDF for such operations in batches. Select the option of high quality print and then press OK twice and you should be good to go.

    -Dov

Maybe you are looking for