FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

iTunes Question
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Salling Clicker for Mac
View previous topic :: View next topic  
Author Message
jenenr_nimh
Newbie


Joined: 12 Oct 2005
Posts: 2

PostPosted: Wed Oct 12, 2005 10:15 pm    Post subject: iTunes Question Reply with quote

Is there any way to configure Clicker to be able to select the Airtunes output location? I can't seem to figure out how to AppleScript it...

Thanks!

Matthew
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Wed Oct 12, 2005 10:16 pm    Post subject: Re: iTunes Question Reply with quote

Let me check if the massive 5 -> 6 update fixed that... Hold on.

EDIT: I cannot find any additions in the scripting dictionary to the effect of controlling which speaker should be used. Bummer!

Best.
--
Jonas

jenenr_nimh wrote:
Is there any way to configure Clicker to be able to select the Airtunes output location? I can't seem to figure out how to AppleScript it...

Thanks!

Matthew
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chinchilla
Newbie


Joined: 13 Oct 2005
Posts: 7
Location: Zurich, Switzerland

PostPosted: Fri Oct 14, 2005 11:50 am    Post subject: Re: iTunes Question Reply with quote

Hi

Since I first used Clicker, I'm checking every new iTunes Version for that feature in the Applescript Library. But no way.
Anyway, because I needed that feature, I did it with UI scripting.

The attached script will first position the iTunes window at some place, then the mouse moves over and chooses the other speaker. Afterwards, it will position the iTunes window where it was before the script was executed.

I know it's kind of ugly, but it works for me (almost 1 year now). There are just 2 limitations I'm aware of:


  1. You can only swap between the speakers. You don't know which one was selected before.
  2. It doesn't work with more than 1 airTunes.


Cheers
Mario

jenenr_nimh wrote:
Is there any way to configure Clicker to be able to select the Airtunes output location? I can't seem to figure out how to AppleScript it...

Thanks!

Matthew



switchspeaker.cgz
 Description:
Swap between internal speaker and airtunes

Download
 Filename:  switchspeaker.cgz
 Filesize:  5.32 KB
 Downloaded:  929 Time(s)



Last edited by chinchilla on Fri Oct 14, 2005 1:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Fri Oct 14, 2005 12:03 pm    Post subject: Reply with quote

Taken care of. You can upload it now.

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


Joined: 04 Aug 2004
Posts: 89

PostPosted: Fri Oct 14, 2005 3:40 pm    Post subject: Reply with quote

Correct me if I'm wrong, but I had a quick look at the iTunes 6 preferences window and at least the UI now seems to be scriptable..? I know it wasn't in earlier versions. I don't have AirTunes myself, so I don't get the speaker drop-down menu on my machine and hence can't try if UI scripting would be the solution...
Back to top
View user's profile Send private message
a.kaiser
Newbie


Joined: 14 Oct 2005
Posts: 11
Location: Nantes, France

PostPosted: Fri Oct 14, 2005 4:44 pm    Post subject: Reply with quote

Hi to all
Hi Jonas,

Airtunes seems to be the most important limitation for Clicker. I use it myself for more than a year to control iTunes via BT with an old T68. Everything works fine. At the time I built my server, I ask Jonas if it could be possible to switch between Airtunes locations. He told me that it was impossible and that's what he's always telling.

Just an idea. If Clicker can launch an application, it could launch an AppleScript that could run Automator that may change the location by creating a task. Am I wrong or not ? In that case, Clicker will become the remote I am dreaming about because I've got 3 Airport express to spread the music all over my home. Coupler with a wifi Palm Tungten it will be the remote Apple would never build !
Back to top
View user's profile Send private message Visit poster's website AIM Address
salling
Site Admin


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

PostPosted: Fri Oct 14, 2005 4:51 pm    Post subject: Reply with quote

Automator can't change speakers either, afaik. Sorry.

My only advice now is that you spam Apple with this feature request. It's the only thing that'll help.

- jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
senseinai
Junior Member


Joined: 27 Apr 2005
Posts: 45
Location: victoria bc canada

PostPosted: Fri Oct 14, 2005 7:09 pm    Post subject: Reply with quote

Using what i saw in Mario's (chinchilla) script, here is what i worked out to go to either of my two airtunes if the starting place is 'computer'. i have itunes sitting near the top of the screen, so the dock is not a problem:

try
tell application "iTunes"
activate
set isVisible to visible of windows whose name is "iTunes"
if (not isVisible) then
set visible of windows whose name is "iTunes" to true
end if
move mouse {1026, 768}
tell application "SEC Helper"
show screen message "xPress 1" duration 1.5
simulate mouse button down number 1
delay 0.2
simulate mouse button up number 1
delay 0.2
simulate mouse movement x 0 y 16 speed 0
delay 0.2
simulate mouse button down number 1
delay 0.2
simulate mouse button up number 1
end tell
end tell
on error
beep
end try

and, so, this is to choose the second airtunes:

try
tell application "iTunes"
activate
set isVisible to visible of windows whose name is "iTunes"
if (not isVisible) then
set visible of windows whose name is "iTunes" to true
end if
move mouse {1026, 768}
tell application "SEC Helper"
show screen message "xPress 2" duration 1.5
simulate mouse button down number 1
delay 0.2
simulate mouse button up number 1
delay 0.2
simulate mouse movement x 0 y 36 speed 0
delay 0.2
simulate mouse button down number 1
delay 0.2
simulate mouse button up number 1
end tell
end tell
on error
beep
end try

you could either move your itunes window so that my first coordinates (1026, 768) position your cursor over the dropdown menu, or change them till it does. the rest should work.

still clunky in that i'd have to write two more scripts to move from one airtunes to another if not starting from 'computer'.

maybe someone with more scripting experience could sophisticate this until apple gets its act together

senseinai
Back to top
View user's profile Send private message Visit poster's website
senseinai
Junior Member


Joined: 27 Apr 2005
Posts: 45
Location: victoria bc canada

PostPosted: Fri Oct 14, 2005 7:43 pm    Post subject: Reply with quote

i just solved the problem of switching between airtunes if you are not on 'computer':

starting from 'computer', if you click the first script you get 'airtunes1'; click it again, you get 'airtunes2'.

that just leaves getting from 'airtunes2' to 'airtunes1'. again, this is clunky because i have little experience with scripting: in my second script above, change the 'y' position from '36' to '-56'. that way you will return to 'computer' and one click of the first script will get you to 'airtunes1'.

with these two scripts, either as is, or with the first coordinates changed to suit your itunes window position, you should be able to switch between two aitunes until either someone improves/sophisticates what i've done or steve jobs takes time from designing an ipod the size of a fingernail to notice this issue,

ron
Back to top
View user's profile Send private message Visit poster's website
a.kaiser
Newbie


Joined: 14 Oct 2005
Posts: 11
Location: Nantes, France

PostPosted: Mon Oct 17, 2005 2:30 pm    Post subject: Reply with quote

Hi to all,

If I understand well iTunes is now fully scriptable. I will try the scripts described above...

Congratulations to all 'cause I'm basically unable to write any kind of program, you're doing a grand job !

Alex
Back to top
View user's profile Send private message Visit poster's website AIM Address
a.kaiser
Newbie


Joined: 14 Oct 2005
Posts: 11
Location: Nantes, France

PostPosted: Tue Oct 18, 2005 2:07 pm    Post subject: Reply with quote

Hi,

I downloaded the scripts. I try the envolved scripts as directed but it doesn't work...

I put iTunes on the top left corner of my screen well outside the dock range (put it on the right side of the screen). The script stops selecting the first selected Airtunes base (which is the actual one). I'm using 800x600 resolution (remote desktop control of a G3 server), could it be a factor ?

Thanks
Back to top
View user's profile Send private message Visit poster's website AIM Address
a.kaiser
Newbie


Joined: 14 Oct 2005
Posts: 11
Location: Nantes, France

PostPosted: Tue Oct 18, 2005 2:11 pm    Post subject: Reply with quote

I changed resolution and it doesn't work still...
Back to top
View user's profile Send private message Visit poster's website AIM Address
a.kaiser
Newbie


Joined: 14 Oct 2005
Posts: 11
Location: Nantes, France

PostPosted: Tue Oct 18, 2005 5:28 pm    Post subject: Reply with quote

To all developping a script to change output location. As I'm equiped with 3 express all linked to a strereo device I'll be happy to help in testing. Feel free to contact me at al.kaiser@laposte.net.
Back to top
View user's profile Send private message Visit poster's website AIM Address
chinchilla
Newbie


Joined: 13 Oct 2005
Posts: 7
Location: Zurich, Switzerland

PostPosted: Mon Oct 24, 2005 7:01 pm    Post subject: Reply with quote

Hi

I've tried another solution in the meantime, as apple will probably never make the speakers scriptable. So I've found a small application on www.versiontracker.com called "Airfoil 1.0.6".
It's a 20$ Shareware which makes it possible to stream the audio from any application to an airport express.
After testing the software successfully, I've scripted all functions of Airfoil for SallingClicker.
  • Selecting recent or open applications as sound source
  • Getting a list of Speakers on the mobile to choose one of them
  • Start/Stop transmitting
  • Adjust the output volume of the speaker

With this solution, it doesn't matter how many airports you have and you can even stream sound from an internet radio on a webpage or whatever.

If someone is interested in my .cgz Script, here it is....

EDIT: added 2 additional scripts to .cgz

Cheers
Mario



Airfoil-new.cgz
 Description:
Control Airtunes speakers with Airfoil
- updated version with additional combined scripts for "select speaker & transmit" and also "select speaker/transmit and choose iTunes as streaming application"

Download
 Filename:  Airfoil-new.cgz
 Filesize:  32.73 KB
 Downloaded:  1419 Time(s)



Last edited by chinchilla on Wed Oct 26, 2005 12:20 am; edited 1 time in total
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Mon Oct 24, 2005 7:03 pm    Post subject: Reply with quote

Brilliant. People: let me know how this works for you.

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 -> 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 can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group