Applescript Error

Posted on
Sat Apr 21, 2018 6:26 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Applescript Error

On running this script:
Code: Select all
tell application "Chrome" of machine "eppc://Display:0@192.168.1.90" to set URL of active tab of window 1 to "http://192.168.1.80:8176/controlpage?name=Display%20Front%20Camera&useJS=True"


I get this error.

Error script error: Can’t make "at" into type integer. (-1700)
Action Group Display Front Camera
Error script error: Chrome got an error: Application isn’t running. (-600)

Any help appreciated..maybe convert to Python?

edit: This error just started after upgrading to OSX 10.12

Thanks,

Carl

Posted on
Sun Apr 22, 2018 7:43 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Applescript Error

If Chrome is closed you may need to call
Code: Select all
tell application "Chrome" to activate


Can you run this in the AppleScript editor without problems?

If you save this as a script you can use my plugin to run it (among other methods), but converting to Python is simply encapsulating your command around an AppleScript call anyway since there is no "direct" translation to Python to tell Chrome to open a page.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Sun Apr 22, 2018 8:35 am
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Applescript Error

No, it doesn’t run in the AS editor either. Chrome is definitely running on a separate mini that I use
to display various control pages.
Hoping there’s some way to get back that communication to have
it load different CP’s or my system is really crippled.

Thanks,

Carl

Posted on
Sun Apr 22, 2018 8:52 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Applescript Error

That eppc command is obviously running this on a remote system, did you verify that you have remote login enabled and that the password is correct? EPPC has broken on me so many times I have all but stopped using it, but one thing I did end up doing was creating an AppleScript on the target computer and instead of trying to run a complex command over EPPC I instead just told it to run that AppleScript saved as an app on the target computer. I did this with Plex for quite a while, just created a 'Start Plex' and 'Stop Plex' script-as-an-application on my Plex server and would run the EPPC to simply 'Start Plex', that way I could be certain that the script ran fine in it's target environment and all I had to worry about was doing it remotely.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Sun Apr 22, 2018 2:05 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Applescript Error

I had thought of that approach but was hoping I could avoid making the 30+ scripts on the Display machine.

I’ll give that a try.
Do you have an example script of how to run an app on the remote machine?
I assume I should save the scripts as apps.

Thanks,

Carl

Posted on
Sun Apr 22, 2018 2:12 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Applescript Error

Yes, save them as apps. You don't have to, but it makes it easier. Just try this script first and run it via EPPC again and see if things improve or stay the same. If they stay the same but the script works on the target then you know the problem is the EPPC. You can run an SSH to the remote machine and execute the scripts as well, but that requires a library and a more complicated script. Maybe I'll look at adding those to my AppleScript plugin as options.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Sun Apr 22, 2018 2:18 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Applescript Error

Sorry, but did you mean to post a sample script?
Great if you could.

Thanks,

Carl

Posted on
Sun Apr 22, 2018 2:33 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Applescript Error

I was referring to the script you already posted, put that into an app and try running that first with your EPPC, i.e., 'tell application "My Script" to activate'.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Sun Apr 22, 2018 2:38 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Applescript Error

Been trying versions of that with no joy.
I put the sample app in the Applications folder, assuming that would be the default for running an app.

Seems no matter what I try, the return is “Application not running”.

Thanks,

Carl

Posted on
Sun Apr 22, 2018 8:56 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Applescript Error

This one compiles but still no joy. Maybe getting closer?

Code: Select all
set remoteMachine to "eppc://Display:0@192.168.1.90"

using terms from application "Google Chrome"
   try
      tell application "Chrome" of remoteMachine
         set URL of active tab of window 1 to "http://192.168.1.80:8176/controlpage?name=Display%20Front%20Camera&useJS=True"
      end tell
   end try
end using terms from


Thanks,

Carl

Posted on
Tue Apr 24, 2018 10:13 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Applescript Error

Error script error: Chrome got an error: Application isn’t running. (-600)


That error is the same one that's plagued us for years. Are there multiple versions of the Chrome app on your remote Mac? That might be causing the issue.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Apr 24, 2018 11:18 am
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Applescript Error

No. Just one Chrome app on the receiving machine.
The machine I need to control is running 10.6.8 if that matters. Executing the script from 10.8 to 10.6 worked fine.
Upgrading from 10.8 to10.12 broke it, along with a bunch of other vital things.

Thanks,

Carl

Posted on
Tue Apr 24, 2018 11:40 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Applescript Error

Unfortunately, this exact behavior from Apple is one of the big reasons we're leaving AppleScript behind.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Apr 24, 2018 11:51 am
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Applescript Error

Understandable....albeit there doesn’t seem to any other way to control an app on a remote computer.

Carl

Posted on
Tue Apr 24, 2018 1:20 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Applescript Error

ckeyes888 wrote:
Understandable....albeit there doesn’t seem to any other way to control an app on a remote computer.


That's not something we can fix - it's an Apple issue.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 8 guests