FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Switch to a different script via keypad input?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Mac
View previous topic :: View next topic  
Author Message
illuminati
Newbie


Joined: 14 Oct 2005
Posts: 14

PostPosted: Thu Oct 27, 2005 8:35 am    Post subject: Switch to a different script via keypad input? Reply with quote

Is there a way to assign a keyCode to launch another Salling Clicker app? I know you can do it as a menu option, but I was curious if there is a more direct way by directly assigning one of my phone's keys to launch the program.
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Thu Oct 27, 2005 9:31 pm    Post subject: Reply with quote

I'm having a hard time following you. Are you talking about invoking a "secondary" script from a keypad widget? Yes, you should be able to do that (in the same way as it's done from a menu).

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
illuminati
Newbie


Joined: 14 Oct 2005
Posts: 14

PostPosted: Thu Oct 27, 2005 9:41 pm    Post subject: Reply with quote

Here is my goal.

I have an iTunes remote control script. I want the camera button to run a Front Row remote control script.
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Thu Oct 27, 2005 11:50 pm    Post subject: Reply with quote

Hi!

Thanks for being specific. This should be trivial, assuming you are up to making changes to (or preferably, making changes in a copy of) the iTunes script.

In your original question, it sounded like you had sussed how to invoke other scripts from menus. Is this not correct?

Best.
--
Jonas

[quote="illuminati"]Here is my goal.

I have an iTunes remote control script. I want the camera button to run a Front Row remote control script.[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
illuminati
Newbie


Joined: 14 Oct 2005
Posts: 14

PostPosted: Fri Oct 28, 2005 2:06 am    Post subject: Reply with quote

I really meant what my second post said. My first post came out wrong.

I already know how to make another script load from the menu. I was curious if there was a way to launch another script by pressing a single key on the phone.

For example, I would like to modify an iTunes remote program so that my Front Row remote control will load if I press the camera button on my phone.

I already tried adding the "leave to script uuid" command, but the program does not switch to the other remote control script.
Back to top
View user's profile Send private message
Apollo
Junior Member


Joined: 18 Oct 2005
Posts: 43

PostPosted: Fri Oct 28, 2005 4:28 am    Post subject: Reply with quote

I see what you are asking. You want one of your hard buttons (camera) to actually open a completely different script from within some other script.

To do this you want to get the UUID of the script you are trying to link to and put this code in your script.

[code:1]
theTerminal.ExecuteScript("f3249e52-9156-4ac2-84c6-520695886816");
[/code:1]

Where the long line of numbers is your UUID. This snippet should be placed somewhere below a link value for one of your hard keys. (I don't know what the camera value is on your phone but you can run a diagnostic so that your device will show what key is being pressed on your computer screen.) This code would replace a script snippet such as

[code:1]
SendKeystroke( 0x26, false );
[/code:1]

Because instead of sending a keystroke you want to send an execute script command.

I hope that helps!

~*Apollo*~
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Fri Oct 28, 2005 2:02 pm    Post subject: Reply with quote

Thanks Apollo, but that's JScript code. ;-) This gentleman is going to need the AppleScript stuff:

[code:1]
tell app "SEC Helper" to execute script uuid "UUID"
[/code:1]

Where "UUID" is a string with your secondary script's UUID. Find it in the Get Info dialog.

I hope this helps.

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Apollo
Junior Member


Joined: 18 Oct 2005
Posts: 43

PostPosted: Fri Oct 28, 2005 3:42 pm    Post subject: Reply with quote

oh lol! My bad!!! I forgot I was in the Mac forum...silly me lol!
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Fri Oct 28, 2005 3:59 pm    Post subject: Reply with quote

Your eagerness to help out is still appreciated. Keep it up.

Cheers.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
illuminati
Newbie


Joined: 14 Oct 2005
Posts: 14

PostPosted: Fri Oct 28, 2005 8:34 pm    Post subject: Reply with quote

Thank you both for your replies.

I tried the command execute script uuid, but my phone still keeps the iTunes script on. Do I need some other code to make SEC kill the iTunes remote before attempting to execute the other remote control script?
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Fri Oct 28, 2005 9:05 pm    Post subject: Reply with quote

Could you please export and attach your script? I'll have a look at it over the weekend.

Cheers.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
illuminati
Newbie


Joined: 14 Oct 2005
Posts: 14

PostPosted: Fri Oct 28, 2005 10:51 pm    Post subject: Reply with quote

Here is the script. It is basically your iTunes remote script modified with the camera button configured to try and launch the Front Row remote control script.
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Sat Oct 29, 2005 2:28 pm    Post subject: Reply with quote

"execute script" in the key handler works fine for me. Why do you have this line in your script?

[code:1]
leave to script uuid ...
[/code:1]

Any script errors in the log?

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
illuminati
Newbie


Joined: 14 Oct 2005
Posts: 14

PostPosted: Sat Oct 29, 2005 7:04 pm    Post subject: Reply with quote

I don't know why I had the leave to script uuid in the key handler. But my cell phone is not showing the Front Row remote control when I press the camera button. It just refreshes the iTunes remote control screen. Is it executing the script but exiting immediately?
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Sat Oct 29, 2005 7:22 pm    Post subject: Reply with quote

Did you check the Script Log for errors like I asked you to?

I took your posted solution, removed out the "leave" statement, changed the ":c" keycode to "7" (which is available on the phone I had at hand), and changed UUID to another script I had, and this worked fine.

I'll give it a shot on an older Sony Ericsson phone, but I'd like to first hear about the script log before I spend that time. Also, remove the "leave" statement.

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Mac All times are GMT + 2 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group