Page 1 of 2

Applescript Error

PostPosted: Sat Apr 21, 2018 6:26 pm
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

Re: Applescript Error

PostPosted: Sun Apr 22, 2018 7:43 am
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.

Re: Applescript Error

PostPosted: Sun Apr 22, 2018 8:35 am
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

Re: Applescript Error

PostPosted: Sun Apr 22, 2018 8:52 am
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.

Re: Applescript Error

PostPosted: Sun Apr 22, 2018 2:05 pm
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

Re: Applescript Error

PostPosted: Sun Apr 22, 2018 2:12 pm
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.

Re: Applescript Error

PostPosted: Sun Apr 22, 2018 2:18 pm
by ckeyes888
Sorry, but did you mean to post a sample script?
Great if you could.

Thanks,

Carl

Re: Applescript Error

PostPosted: Sun Apr 22, 2018 2:33 pm
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'.

Re: Applescript Error

PostPosted: Sun Apr 22, 2018 2:38 pm
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

Re: Applescript Error

PostPosted: Sun Apr 22, 2018 8:56 pm
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

Re: Applescript Error

PostPosted: Tue Apr 24, 2018 10:13 am
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.

Re: Applescript Error

PostPosted: Tue Apr 24, 2018 11:18 am
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

Re: Applescript Error

PostPosted: Tue Apr 24, 2018 11:40 am
by jay (support)
Unfortunately, this exact behavior from Apple is one of the big reasons we're leaving AppleScript behind.

Re: Applescript Error

PostPosted: Tue Apr 24, 2018 11:51 am
by ckeyes888
Understandable....albeit there doesn’t seem to any other way to control an app on a remote computer.

Carl

Re: Applescript Error

PostPosted: Tue Apr 24, 2018 1:20 pm
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.