Indigo and multiple users ...

Posted on
Tue Jul 24, 2007 7:32 am
rlesperance offline
Posts: 333
Joined: Dec 01, 2004
Location: Québec, Canada

Indigo and multiple users ...

Hello,

I use Indigo 1.8.2 on a NON-ADMIN user (let's call it HOME) that opens automatically upon startup. This way Indigo is restarted when not at home and after a power failure.

My user is an ADMIN and is password protected (let's call it ME). I would like to open a device with Indigo without having to switch to the HOME user.

Is it possible to activate by script and from ME Indigo that is working in background on HOME ?


Robert

Posted on
Tue Jul 24, 2007 7:41 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Indigo and multiple users ...

Hi Robert,

I believe you should be able to use Applescript's remote machine targeting to do this. For the address use "127.0.0.1".

Note that with Indigo 2.0 you can run the client under any OS X account (on the same Mac or a different Mac) and target the Indigo Server running on a different account, or you can use the built-in web server for access from any account.

Regards,
Matt

Posted on
Tue Jul 24, 2007 7:12 pm
rlesperance offline
Posts: 333
Joined: Dec 01, 2004
Location: Québec, Canada

(No subject)

Hi MAtt,

I used this script to test:

Code: Select all
property ipNumber : "192.168.0.102"
property userName : "Accueil"
property pasword : ""

set remMachine to "eppc://" & userName & ":" & pasword & "@" & ipNumber

tell application "Finder" of machine remMachine
   activate application "Microsoft Word"
end tell


It activates MS Word on my user not the NON ADMIN user. I also tried with the IP "127.0.0.1" and it does the same thing.

Posted on
Tue Jul 24, 2007 9:53 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

(No subject)

Is the user "Accueil" the admin or non-admin user?

I'm not positive telling the Finder to activate an application is the best test. I don't know if the OS runs more than 1 copy of the Finder for each user running.

Matt

Posted on
Wed Jul 25, 2007 4:31 am
rlesperance offline
Posts: 333
Joined: Dec 01, 2004
Location: Québec, Canada

(No subject)

«Accueil» is the NON-ADMIN and NON-PASSWORDED user where INDIGO is installed.

Posted on
Wed Jul 25, 2007 6:31 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

(No subject)

So what happens when you try this:

Code: Select all
property ipNumber : "192.168.0.102"
property userName : "Accueil"
property pasword : ""

set remMachine to "eppc://" & userName & ":" & pasword & "@" & ipNumber

using terms from application "Indigo"
   tell application "Indigo" of machine remMachine
      log "hello, does this work?"
   end tell
end using terms from


After you run it a few times, switch over to your non-admin account and see if anything showed up in the Event Log window.

Lastly, did you enable Remote Apple Events inside the Sharing system settings panel? It has to be on for it remote AppleScript targeting to work.

Matt

Posted on
Wed Jul 25, 2007 7:15 am
rlesperance offline
Posts: 333
Joined: Dec 01, 2004
Location: Québec, Canada

(No subject)

Hi Matt,

Nothing happens neither ... even with the "127.0.0.1" IP adress you gave me.


Robert


P.S. : "192.168.0.102" is my computer's IP adress. Is this the one to use or should I use "127.0.0.1" ?

Posted on
Wed Jul 25, 2007 7:57 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

(No subject)

I just tried it on my system and didn't have any problems. I used 127.0.0.1 for the IP address, although I believe the LAN IP address should also work.

Did you turn on Remote Apple Events?

And you don't get any type of error or anything?

For the userName I used the short user name versus the full user name. I'm not sure if that matters or not.

Matt

Posted on
Wed Jul 25, 2007 8:12 am
rlesperance offline
Posts: 333
Joined: Dec 01, 2004
Location: Québec, Canada

(No subject)

On my computer (french) the «Apple Events Distants» and «Apple Remote Desktop» services are activated.

?????

Posted on
Wed Jul 25, 2007 8:22 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

(No subject)

And you don't get any type of error or anything? I'm surprised you aren't getting an error. How are you running the script? I'm using the Script Editor. What exactly happens when you press the Run button in the Script Editor?

And have you tried rebooting your Mac?

Matt

Posted on
Wed Jul 25, 2007 10:49 am
rlesperance offline
Posts: 333
Joined: Dec 01, 2004
Location: Québec, Canada

(No subject)

I execute the script in the Apple's Script Editor. I get a window that requires an authentification and that I give Accueil's password. Why should it require my password if it is included in the script ? No error message.

I rebooted my iMac and I get the same result.

Best regards.



Robert

Posted on
Wed Jul 25, 2007 10:51 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

(No subject)

Try changing your password for Accueil to something like "123", and then try using that in the script. I think it has something to do with the authentication failing, but I'm not sure what.

Note that when I tried it, I was not prompted for a password.

Matt

Posted on
Sat Jul 28, 2007 9:20 am
rlesperance offline
Posts: 333
Joined: Dec 01, 2004
Location: Québec, Canada

(No subject)

Hi Matt,

The problem is fixed. I had to fine tune the script a little bit. Have a look to this MacScripter thread (or at least the end of it) for more details, because I am not sure I could explain it precisely. This is the final script:

Code: Select all
property userName : "AdminName"
property pasword : "123456"
property remoteID : "508"

set {host name:HostName} to (system info)
set remMachine to "eppc://" & userName & ":" & pasword & "@" & HostName & "/?uid=" & remoteID

using terms from application "Indigo"
   tell application "Indigo" of machine remMachine
       if on state of device "Device1" is false then
           turn on "Appareil - Imprimante"
       else
           turn off "Appareil - Imprimante"
       end if
   end tell
end using terms from


Thanks again for helping. Your help is always wise and very helpfull. Hope I could be of some help my self sometime.

Best regards.

Posted on
Mon Jul 30, 2007 5:01 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

(No subject)

Hi Robert,

Thanks for the follow-up solution!

Regards,
Matt

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 9 guests