Applescript Error

This subforum has been locked since we no longer support AppleScript.
ckeyes888
Posts: 2431
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Applescript Error

Post by ckeyes888 »

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
User avatar
Colorado4Wheeler
Posts: 2794
Joined: Mon Jul 20, 2009 10:48 am
Location: Colorado

Re: Applescript Error

Post by Colorado4Wheeler »

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
ckeyes888
Posts: 2431
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Applescript Error

Post by ckeyes888 »

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
User avatar
Colorado4Wheeler
Posts: 2794
Joined: Mon Jul 20, 2009 10:48 am
Location: Colorado

Re: Applescript Error

Post by Colorado4Wheeler »

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
ckeyes888
Posts: 2431
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Applescript Error

Post by ckeyes888 »

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
User avatar
Colorado4Wheeler
Posts: 2794
Joined: Mon Jul 20, 2009 10:48 am
Location: Colorado

Re: Applescript Error

Post by Colorado4Wheeler »

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
ckeyes888
Posts: 2431
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Applescript Error

Post by ckeyes888 »

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

Thanks,

Carl
User avatar
Colorado4Wheeler
Posts: 2794
Joined: Mon Jul 20, 2009 10:48 am
Location: Colorado

Re: Applescript Error

Post by Colorado4Wheeler »

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
ckeyes888
Posts: 2431
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Applescript Error

Post by ckeyes888 »

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
ckeyes888
Posts: 2431
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Applescript Error

Post by ckeyes888 »

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
User avatar
jay (support)
Site Admin
Posts: 18420
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Applescript Error

Post by jay (support) »

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
ckeyes888
Posts: 2431
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Applescript Error

Post by ckeyes888 »

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
User avatar
jay (support)
Site Admin
Posts: 18420
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Applescript Error

Post by jay (support) »

Unfortunately, this exact behavior from Apple is one of the big reasons we're leaving AppleScript behind.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
ckeyes888
Posts: 2431
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Applescript Error

Post by ckeyes888 »

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

Carl
User avatar
jay (support)
Site Admin
Posts: 18420
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Applescript Error

Post by jay (support) »

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
Locked

Return to “AppleScript Scripting”