Using AppleScript to launch an application on a different machine

Hi there,
I'm trying to use AppleScript to enable a couple of my Macs to talk to each other.
On one machine, I want to use this script:
tell application "Finder" of machine "eppc://user:[email protected]"
launch application "Rivet" of machine "eppc://user:[email protected]"
end tell
to have the other machine launch Rivet, a video server that I can access from the PS3/iPhone/iPad
everything seems to work without issue (i.e. no errors), except it doesn't do anything.
I see a line written to the console on "helium":
9/23/10 18:48:30 com.apple.AEServer[3535] launchproxy[3535]: /System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Versi ons/A/Support/AEServer: Connection from: xxx:xxx:xxx:xxx:xxx:xxx%en0 on port: 60571
every time I run the script on the other machine, but, like I said, nothing else happens.

After much searching and trial and error I finally discoverd Hiroto's suggestion from way back in 2001. It is the only solution I have found that actually works to launch/activate any application on a remote Mac using an applescript on a local Mac.
I have one Mac Mini running household control applications Indigo and iRed. I wanted to use embedded AppleScripts in those applications to launch and control PandoraBoy on another MacMini that I use as a media center. I discovered that you cannot activate an application on a remote Mac unless it's already running. (Only God and Apple know why!) And, of course, if you want to launch and application--it's usually NOT running!
But the following works:
set remoteMachine to "eppc://RemoteMachineName:[email protected]"
tell application "Finder" of machine remoteMachine
open ("/Applications/PandoraBoy.app" as POSIX file as alias)
end tell
THANK YOU HIROTO!!!
Once the remote app is actually launched/activated you can then send AppleScript commands to it as follows:
set remoteMachine to "eppc://RemoteMachineName:[email protected]"
using terms from application "PandoraBoy"
tell application "pandoraboy" of machine remoteMachine
playpause
end tell
end using terms from
I have also learned that the application to be controlled on the remote machine must also be present on the local machine and "using terms from" must also be used in the control script for this to work.

Similar Messages

  • Applescript to launch an application and wait till it exits

    I have written the applescript to launch an application and wait till it exits and but it is not working. Here is the code for that
    tell application "/Applications/Pages.app" to activate
    tell application "/Applications/Pages.app"
        repeat until it is not running
        end repeat
    end tell
    But when I tried to close the app, the script is still running. I think the reason is , even though I closed the window, that process is still running. Can you please help me to solve this problem?

    Trying to make this kind of thing work from the script editor is going to give you headaches. A better approach is to create a script application.  Copy the following code into the Script Editor, and then save it as an application with the "Stay open after run handler" checkbox checked. Then run the resulting script application directly.
    on run
      tell application "Pages" to activate
      -- add a longish delay to allow the application to start
      delay 5
    end run
    on idle
      if application "Pages" is not running then
      -- the application has quit, so go to the 'on quit' handler
      quit
      end if
    end idle
    on quit
      -- do whatever you want to do after the application has quit
      -- allow the app to quit itself
      continue quit
    end quit

  • Using AppleScript to Launch Excel VBA Macro

    Using MS Office 2004 and AppleScript 1.9.3. I want to use AppleScript in MS Entourage to kick off a VBA macro in Excel. But no luck.
    To test things, I created an Excel file ("test.xls") with a one-line VBA macro named "test." It just puts up a dialog box with the message "success." I'm calling it from A.S as follows (per the AppleScript Dictionary for Excel 2004):
    tell application "Microsoft Excel"
    run VB macro "hard disk:users:xxx:desktop:test.xls!test"
    end tell
    I get two successive error messages:
    1. 'test.xls' cannot be accessed. The file may be read-only or you may be trying to access a read-only location."
    2. "Microsoft Excel got an error: "hard disk:users:xxx:desktop:test.xls!test" doesn't understand the run VB macro message."
    "test" file permissions are -rw-r--r-- and it is sitting right on the desktop.
    FWIW, I did not remove the old Office vX yet, but renamed old Excel "Microsoft ExcelOld". I read on some other site that this may cause problems.
    This has been endlessly frustrating. HELP!!??
    Steve

    Hi Steve,
    Have you tried dealing with the return value from your macro? If you are invoking the MsgBox function in your test macro, you may need to allow the return value from MsgBox to pass thru back to AS. Something like :
    set MyRetCode to run VB macro "Macintosh HD:Users:xxx:Desktop:test.xls!test"
    (Note unless you've changed the hard drive name to "hard drive", the default boot drive name will probably be "Macintosh HD". Case does matter here)
    I also suspect you'll need to have Entourage up as well in the full case of running a macro in Entourage from Excel (or the other way around). Hence, the command ActivateMicrosoftApp in the Excel dictionary may also be useful.
    Second, you can have a macro, in a startup template, in Entourage call a macro in a startup template in Excel to accomplish what you want without going into AppleScript at all. This latter, VB-only, method will require a "Reference", as it's called in VBA, to be added to the TemplateProject in Entourage that points to the Excel macro you want to fire off. The added benefit of this latter method is that you will have access to the full range of VBA commands/options, rather than the smaller dictionary available in AS.
    Ed
    PB G4   Mac OS X (10.2.x)  

  • Using AppleScript for launch a raw-query Spotlight search?

    As per usual with my limited scripting skills, I am finding the apparently simple stuff rather difficult to achieve.
    My problem with Spotlight is that I want to use the same type of raw query repeatedly, but I want to avoid the tedium of having to:
    1) open my saved search
    2) choose "Show Criteria" to make the saved raw query visible
    3) edit the text field containing the raw query, where the visible stuff is not what I want to edit, so I have to scroll to the right within that tiny field
    So my idea would be to design a simple UI with AppleScript that
    1) pops up a dialog asking for a phrase to search
    2) launches a Spotlight search using the raw query:
    kMDItemTextContent=="xxx*"
    where "xxx" is the phrase that I am searching for, and opens a Finder window with the results of that search.
    My reason for wanting to do this is that, by default, a search for an exact phrase with Spotlight fails to return matches that contain the plural form when the searched phrase is a singular.
    See:
    http://www.betalogue.com/2010/05/07/spotlight-plural/
    http://www.betalogue.com/2010/05/11/spotlight-phrase/
    for more information about the background for this.
    Would this be relatively easy to do with AppleScript?
    Thanks in advance.
    Pierre

    Hi
    Pierre Igot wrote:
    Am I correct in assuming that this means that what I wanted could not just be achieved with AppleScript and required a Perl script?
    Message was edited by: Pierre Igot
    A smart folder is an XML file (PLIST), you can edit it in many ways.
    It's possible with other shell commands (sed or awk).
    But perl works seamlessly with extended characters (ASCII > 127)
    Also it's possible with AppleScript commands (open for access, read, write, close access), or with *property list file* in System events
    But it requires more lines of code.
    Here's the script :
    global a_text
    set smartFolder to "/Users/jack/Library/Saved Searches/Recherche dans “Bureau”.savedSearch"
    set a_text to text returned of (display dialog "Enter a phrase to search" default answer "")
    if a_text contains """ then
    set a_text to findAndReplace(""", "\"", a_text)
    end if
    tell application "System Events"
    set TheXML to property list file smartFolder
    repeat with i in (get property list items of contents of TheXML)
    set t_name to name of i
    if t_name is "RawQuery" then
    tell i to set value to my replace_text(get value)
    else if t_name is "SearchCriteria" then
    tell property list item 2 of property list item "displayValues" of property list item 1 of property list item "FXCriteriaSlices" of i to set value to my replace_text(get value)
    else if t_name is "RawQueryDict" then
    tell property list item "RawQuery" of i to set value to my replace_text(get value)
    end if
    end repeat
    end tell
    set smartFolder to ((POSIX file smartFolder) as alias)
    tell application "Finder"
    activate
    open smartFolder
    end tell
    on replace_text(t)
    set x to the offset of "kMDItemTextContent==" in t
    set L to length of t
    repeat with i from L to 1 by -1
    if character i of t = """ then
    set y to i
    exit repeat
    end if
    end repeat
    return (text 1 thru (x + 20) of t) & a_text & (text y thru -1 of t)
    end replace_text
    on findAndReplace(tofind, toreplace, t)
    set ditd to text item delimiters
    set text item delimiters to tofind
    set t to text items of t
    set text item delimiters to toreplace
    set t to t as string
    set text item delimiters to ditd
    return t
    end findAndReplace

  • How to append paragraph in text file of TextEdit application using applescript

    how to append paragraph in text file of TextEdit application using applescript and how do i save as different location.

    christian erlinger wrote:
    When you want to print out an escape character in java (java is doing the work in client_text_io ), you'd need to escape it.
    client_text_io.put_line(out_file, replace('your_path', '\','\\'));cheersI tried replacing \ with double slash but it just printed double slash in the bat file. again the path was broken into two lines.
    file output
    chdir C:\\DOCUME~1\
    195969\\LOCALS~1\\Temp\
    Edited by: rivas on Mar 21, 2011 6:03 AM

  • Use Applescript to have Quicktime record audio

    I need to record and store an audio file of approximately 20 minutes in length in Filemaker Pro 13. I thought I could use Applescript to Launch Quicktime to do the recording, then tell Quicktime what folder to store it in as an MP3 file. I can't seem to understand the Quicktime dictionary to figure out how to do this.

    Thank You. I figured out what I needed to do. I did however also start playing around with applescript and seeing how one can read messages using applescript. Every example that I saw used the "get selection" term after the "tell application 'mail' " command. I guess that is supposed to get every message in the mailbox. When I tried it, all I got was an empty array. It didn't matter if I had a mailbox selected or a message selected. It also didn't matter if it was a new message or one that was already read. Is there supposed to be another command before the get selection? Seeing how this command seems to be in several examples that I have seen on the internet, I have to assume that it should work but it isn't working for me.

  • EventHandler Error while using AppleScript

    hi,
    I use AppleScript to launch Acrobat and run a preflight. Running this a script creates an "Not specfied EvnetHandler Error".
    I guess it come from resolving the filename and path. May somebody nows the "way" to define the preflight profile directly in the script.
    on run this_file
    try
    process_item(this_file)
    end try
    end run
    -- this sub-routine processes files
    on process_item(this_item)
    try
    tell application "Finder"
    set myPath to path to me
    end tell
    with timeout of 1 second
    tell application "Adobe Acrobat Pro"
    activate
    delay 1
    «event PRFLPRFL» this_item given «class PATH»:myPath
    end tell
    end timeout
    end try
    end process_item

    user10310678 wrote:
    I am using beta version. Oracle VM Manager 2.2.0If you have a beta version of 2.2, then you should be an Oracle employee. Please ask this question on an internal mailing list. If you are not an Oracle employee, please ask the employee that gave you this beta. As this is a beta, some functionality may not be operational yet, so I can't answer why this particular feature seems not to work.

  • Creative cloud applications keep asking me to login every time I launch an application

    Creative cloud applications keep asking me to login every time I launch an application on a same machine.
    How to solve this problem?
    Windows 7 Professional.

    Or it could be patially related to typical pains when a company makes an enormous transition like this. Ironcially, just as i said in my post, my issue resolved the next day.
    Listen, I undertstand the concern and certainly the frustration. I spend nothing short of 14 hours per day with Adobe apps open. primarily After Effects, Photoshop and Illustrator. I know the hassle and I know the frustration of constantly having to sign back in, which i did for a bit too. But it's just a little melodramatic when people make idle threats they aren't going to follow through with anyway, about using a product that does what this does, and is such an enormous productivity tool that people say silly things. that's what I'm referring to. If you're going to choose an entire platform different than Adobe becuase theyr'e having issues on a brand new method of service and delivery you're an idiot anyway. Wouldn't you agree that the statements of ' i don't have time to test something' are a litle ridiculous? name any product, or purchase in any part of your life that has never failed at anything? and then saying thigns like it's suddenly an unstable environment, when the problem they're complaining about (and the complaint of course it legitimate) has absolutely nothing to do with the stability of the product?
    it's the overblown, silly statements that make people look foolish, do nothing to help the issue, and offer nothing that crack me up. When I read someone saying things like that i pretty much ignore anything else they say because reason isn't something they are using at that point anyway.
    See what you said? that has nothing to do with anyone I'm talking about. You made a valid point, didn't make silly comments like what I'm referring to. you said something I don't agree with, but you dind't go overboard and get all dramatic about it. I don't agree that it's an ongoing degredation of their rep. there is nobody even remotely close a valid competitor out there for this in the first place (depending on what software yoiu're referring to, but since we're in the CC forum i assume that's what you mean). The fact is, their reputation is so strong, no other software company can even compete. But even so I still see progress and innovation. Intel had a cushion with no competitor at one point, then AMD came in, and if you notice, within a couple years of AMD getting very popular, Intel started releasing their upgraded technology in less than a third of the time. But I don't think I see that laziness from Adobe. I don't honestly know that the reason is they moved to a subscription based environment but I know that almost all big software companies are at leasdt considering it. heck Microsoft was talking about changing their licensing and doing it the same way. And it's not for greed I'd guess, it's to comabt theft. At least that's my guess, i have no idea, but i don't believethat it's done and they would change their entire business model for a reason lefss important.
    While we're on that topic I'd like to point out i bet this new process makes an enormous dent in the piracy, at least short term, so for me I applaud it. because when so many people steal the software, it means people like me, and i assume you, pay much higher prices for our legit licenses. So anything that can be done to thwart that has my full approval. But it also just happens to have some nice benefits, in that the pricing is pretty ridiculously low IMO for the entire suite of apps for 50 bucks per month. let' be honest, anyone using them for business which is primarily what this softwre is geared to, understands that while it might seem high, it's tiny compared to the montly cost of doing business, to keep an up to date, suite full of apps that would cost thousands were it not for the subscription. I'll admit, I bought the full suite on the montly just because it made sense. And it actually paid off. Recently I had a client that desperately needed ihs forms migrated to interactive. they were word docs, excel and plain pdfs, but because I happen to have a license for Acrobat, i was able to import those into pdf files and convert them to interactive forms. Then recommend he use the online service to manage them, and frankly it paid for 6 months of licensing for 10 hours work. were it not for the subscription based licensing i'd not have even been able to offer the service because I wouldn't have paid for acrobat.
    Complaining about a piece of software you buy that doesn't work in an area, regardless of where it is, makes perfect sense. But the statements I'm referring to equate to someone buying a house, finding out the key doesn't work, or the doorknob is broke, throwing their hands up and saying 'i'm finding anohter house'. it's silly, and everyone knows there's no merit to it. But i get frustrated seeing it over and over, frewquently by people that hven't even paid for the software. Sometimes I post thing I shouldn't but hey, don't we all?
    I like to browse these forums becuse I'd say i've learned as much of my knowledge by reading tricks, tips and resolutions posted in forums as I did through my classes and education. That's possibly an overstatement but not by much. I do get just as frustrated at the people constantly trying to belitte the company as they do with their issues.

  • TS4513 For me it is no more possible to use AppleScript in MainStage since 3.0.2 !!! Suggestions ?

    Hello,
    In the 3.0.1 version of MainStage, i used AppleScript to launch some actions.
    In 3.0.2 if i launch any AppleScript from MainStage, the program bug.
    Any suggestions ?
    Thank's !

    Yes, on MainStage 3.0.2, when I associate any applescript to a button (Actions->AppleScript->...) and I turn it, i have this bug : the mixer freezes and when I pass a patch to another, the strips are no longer updated. I have to restart MainStage to restore normal behavior ...

  • Using applescript to open "any" images in an specified application?

    I want to use applescript as part of a workflow in Automoator.
    Automator already takes care of the renaming and resizing of my pics.
    Then I want applescript to take each pic that I throw at it and apply it to an image optimizer application I have.
    I've looked all over gooel and I can' find anything.
    Everyscript I see has a specific file name or folder.
    I want applescipt to take a file with any name and launch "ImageOptim" and open the file with ImageOptim.
    This app is a drag and drop app, just drop your pictures on the window or on the icon and it'll optimize your pics on the spot. It doesn't create a new file, the file itself is changed.
    And that's it.
    I had this but it doens't work
    set this_file to choose file without invisibles
    try
              tell application "Finder"
      activate
                        open application file "ImageOptim.app" of folder "Applications" of startup disk
                        set this_image to open this_file
              end tell
    end try
    Thanks for the help.

    Red's already shown you one solution, but your script has multiple errors and it's worth clarifying them
    set this_file to choose file without invisibles
    OK, nothing wrong with this line
              tell application "Finder"
      activate
    There's no need to activate the Finder to perform this task. The Finder's quite happy to run in the background.
                        open application file "ImageOptim.app" of folder "Applications" of startup disk
    This opens the application.
                        set this_image to open this_file
    This would open this_file - except that this command is completely independent and disconnected from the previous command - in other words you're just telling the Finder to open the file, it doesn't care about what other commands you might have asked it to run previously.
    The solution is to tell the Finder to open the file using the specific application you want.
    Another option may be to eschew the Finder altogether, and just tell the app to open the file:
    set this_file to choose file without invisibles
    tell application "ImageOptim" to open this_file

  • Problem in launching webstart application when using version atribute

    Hello Experts,
    I am trying out my first example of JNLP. This is my JNLP file.
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8092/webApplForWebStart" href="launch.jnlp">
        <information>
            <title>ForWebStart2</title>
            <vendor>NAgrawal</vendor>
            <description>ForWebStart2</description>
            <description kind="short">ForWebStart2</description>
            <homepage href=""/>
            <offline-allowed/>
            <shortcut online="true">
              <!-- create desktop shortcut -->
              <desktop/>
              <menu submenu="WebStart Trial"/>
         </shortcut>
        </information>
        <security>
            <all-permissions/>
        </security>
        <resources>
            <j2se version="1.5+"/>
            <jar href="JNLPTime.jar" version="1.0" main="true" download="eager"/>
        </resources>
        <application-desc main-class="TheTime">
        </application-desc>
    </jnlp>My Problem is if I remove version="1.0" from <jar > tag application is launching properly. But if I am using version attribute , it is giving me this error while launching the application.
    "Unable to load resource :( http://localhost:8092/webApplForWebStart/JNLPTime.jar , 1.0)
    java.io.IOException : missing version response from server."
    I can't afford to remove the version attribute as it is required for auto-update. Has anyone ever tried faced such problem.? Please help me. Any help is highly appreciated.Thanks in advance.

    It's just as told.
    If you're using explicit versions, the server response MUST provide an header to tell which version is returned (you could be using 'wildcards' like 1+).
    How are you serving requests? Are you using JnlpDownloadServlet? If so, check docs: extra work is required in order to use version features.
    If using your own service google for header (and parameter) name, use exact versions and copy to the response the value you're retrieving from the request.
    Bye.

  • Installation.  I am trying to install / use Acrobat XI Pro. After installation when I launch the application, it keeps crashing. PS.  I had Acrobat 8 Professional previously.

    PS. I am on Mac OS 10.9.3

    Hi sethup,
    Have you uninstalled Acrobat 8 before installing Acrobat 11?
    Did the installation for Acrobat 11 go without any errors?
    If yes then it might be an issue with the licensing. We might have to check the amt3.log file.
    Do you face the same issue when you try to launch the application in the root user account as well.
    Refer : Enabling and using the "root" user in Mac OS X
    Regards,
    Rave

  • Is there a way to use Automator or Applescript to launch the Mac App Store and download updates automatically?

    As the subject indicates, I'm wondering if anyone knows a way to use AppleScript or Automator to launch the Mac App Store and download any available updates on a set schedule.

    I would advise against this. Updates sometimes reduce functionality or break programs.  I would never get an update with working software unless there is a specific problem you are trying to solve.
    I have read many desperate posts from people trying to go back to earlier versions for various reasons. This is easy to do with disk-based software,  but with downloaded software, going backward can be more difficult.

  • Launching an application in a networked host PC using labview 8.0

    HI all,
            I was wondering if it was possible to launch an application in a networked, host PC using Labview 8.0???? I d appreciate it if any one could reply to this question.
    Thanks.

    You could use VI server to launch an application on another PC. Have a look at the following and go through examples in the Example Finder:
    How Do I Use Remote VI Server Over the Network?
    vi server launch application
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Does possible always to run application "Microsoft Excel" using applescript?

    Does possible always to run application "Microsoft Excel" using applescript (as application startup script) like this "tell application "Microsoft Excel"
    set bounds of window 1 to {0, 22, 1440, 2360}
    end tell"?

    Any ideas/solutions about possibility always to run application "Microsoft Excel" with applescript?

Maybe you are looking for

  • Office 2008 Entourage

    Any comments on how this is working out? In the past I've read some negative comments about the email, which to me is critical. Also I am particularly interested in the MS Exchange Service support. Is it necessary to get the full version, or will it

  • No sound from front center and

    Ok so i have a Audigy 2 ZS, all the speakers are working BUT, the front center sound comes from the back right if it. When I change the jacks over I get no sound what so ever out of the sub and center speaker. HELP!!!!

  • Vendor Master - Export License - MEK3

    All, We have 3 raw material vendors for which we have an export licence. Is there a way to record these in the vendor master ? This would have to affect the conditions leading to the determination of the tax key. We tried the info records, but these

  • "Show Edges" on - Can't Resize

    In Illustrator CS4, I have suddenly not been able to resize by dragging the bounding box. Rather than showing 8 open boxes on the corners and middle, I have 4 closed boxes only on the corners. I can't see a preference that has been clicked to change

  • MAXL excution error

    Hi All, I am using essbase version 11.1.2.3 and trying to execute MAXL script. For example LOGIN "admin" "password" ON localhost; alter system unload application test2; LOGOUT; Showing execution error "alter system unload application test2;, executio