cool, it worked. i have a few more questions about controlling itunes. my app is an itunes controller (remote and local) and when i get the track name using this code:
set theTrack to (get name of current track)
it says it cant make it into type reference.
and my second thing is that my interface is like an ipod, so i need help with the progress bar part, like i want it to show the amount of time remaining and the amount i have listened to and display it in a progress bar like on the ipod.
tell application "iTunes"
set _selection to name of selection as string
end tell
this will return the current playing track.
tell application "iTunes"
if player state is playing then
set _selection to current track
end if
tell _selection to set _Title to (get name)
--tell sel to set _Artist to (get artist)
end tell
oops sorry “if player state is playing then” should be “if player state is not playing then return”
or iTunes will say “variable _selection not defined” if iTunes isn’t playing.
tell application "iTunes"
if player state is not playing then return
set _selection to current track
tell _selection to set _Title to (get name)
--tell sel to set _Artist to (get artist)
end tell
this and the previous posts scripts work fine here using “iTunes 7.3.1 (3)”
tell application "iTunes"
using terms from application "iTunes"
if player state is not playing then return
set _selection to current track
tell _selection to set _Title to (get name)
end using terms from
end tell
and my second thing is that my interface is like an ipod, so i need help with the progress bar part, like i want it to show the amount of time remaining and the amount i have listened to and display it in a progress bar like on the ipod.
A quick search in the forum “Applescript Studio & Xcode” using “progress bar” as the Keyword for searching revealed this huge resource on progress bars