Thursday, April 17, 2014

#1 2011-12-23 07:42:19 pm

Chanced270
Member
Registered: 2011-11-12
Posts: 6
Website

Itunes Applescript

This Script plays a song by name or a play list currently working on my repeat until problem when choosing another object. Any suggestions

Applescript:

(* iTunes Applescript Version 4 *)
tell application "iTunes"
   display dialog "What song or playlist would you like to play" with icon note default answer "Song Name Must be Exact" with title "Choose A Song"
   set trackname to (text returned of result)
   display dialog "The Song or track you choose to play is:" & trackname buttons {"Play song", "Play Playlist", "Choose something else"} default button ("Play Song")
   set cmd1 to (button returned of result)
   if cmd1 is "Play playlist" then
       play playlist trackname
   else if cmd1 is "Play Song" then
       play track trackname
   else if cmd1 is "Choose something else" then
       repeat until cmd1 is "Play song" or "Play Playlist"
           display dialog "What song or playlist would you like to play" with icon note default answer "Song Name Must be Exact" with title "Choose A Song"
           set trackname to (text returned of result)
           display dialog "The Song or track you choose to play is:" & trackname buttons {"Play song", "Play Playlist", "Choose something else"} default button ("Play Song")
           set cmd1 to (button returned of result)
           if cmd1 is "Play playlist" then
               play playlist trackname
           else if cmd1 is "Play Song" then
               play track trackname
           end if
       end repeat
   end if
end tell
(* This Script was wrote for others to learn how to make their own applescripts *)

Here was another script i put together to play different versions of my itunes applescripts

Applescript:

display dialog "Which Version of ITunes applescript would you like to use?" buttons {"Version 4", "Version 3.4", "Version 1"}
set versionchoice to (button returned of result)
if versionchoice is "Version 4" then
   set Version_4 to alias ((path to desktop folder as text) & "Version 4.scpt")
   run script Version_4
else if versionchoice is "Version 3.4" then
   set Version_34 to alias ((path to desktop folder as text) & "Itunes Applescript Version 3.4.scpt")
   run script Versi_34
else if versionchoice is "Version 1" then
   set Version1 to alias ((path to desktop as text) & "Itunes Quick Open.scpt")
   run script Version1
end if


Filed under: iTunes, applescript, play, music

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.035 seconds, 8 queries executed ]

RSS (new topics) RSS (active topics)