- Registriert
- 04.06.12
- Beiträge
- 6.580
Hallo,
ich habe ein Script von Doug Adams mit dem ich mir eine Playlist als Text in die Zwischenablage kopieren kann um es dann in einem Textverarbeitungsprogramm einzufügen. Das ist für DJ Sets ein große Hilfe, wenn man die Playlist herausgeben soll.
Allerdings ist mir das Script fast zu mächtig und bietet verschiedene Exportmöglichkeiten, aber nicht genau die, die ich suche. Könnte mir das jemand anpassen, bzw. neu erstellen? Das wäre sehr nett.
Ich hätte gerne folgenden Textexport in die Zwischenablage: Laufende Nummer in der Playlist Interpret - Name
Bsp: 01 Hans Maier - Liedtitel
ich habe ein Script von Doug Adams mit dem ich mir eine Playlist als Text in die Zwischenablage kopieren kann um es dann in einem Textverarbeitungsprogramm einzufügen. Das ist für DJ Sets ein große Hilfe, wenn man die Playlist herausgeben soll.
Allerdings ist mir das Script fast zu mächtig und bietet verschiedene Exportmöglichkeiten, aber nicht genau die, die ich suche. Könnte mir das jemand anpassen, bzw. neu erstellen? Das wäre sehr nett.
Ich hätte gerne folgenden Textexport in die Zwischenablage: Laufende Nummer in der Playlist Interpret - Name
Bsp: 01 Hans Maier - Liedtitel
Code:
--copyleft 2001 John Paul Davis http://www.johnpauldavis.org
--this module was partially adapted from AppleScripts made available by Apple.
--this specific adaption is covered by the GNU LIMITED GENERAL PUBLIC LICENSE NO WARRANTY
--Do not remove this notice
# Updated with various modern finesses by Doug Adams, december 21 2011
property summary_options : {"Artist • Album • Song • Time", "Album • Artist • Song • Time", "Song • Artist • Album • Time", "Genre • Artist • Album • Song", "Time • Song • Artist • Album", "Song • Artist", "Song"}
property summary_type : (item 1 of the summary_options)
property delimiter_character : " - "
tell application "iTunes"
activate
repeat
display dialog "Export Playlist as Text" & return & return & ¬
"This script will copy the contents of the selected playlist in iTunes to the clipboard. (You will need to manually paste the list into your software of choice.)" & ¬
return & return & ¬
"If no playlist is selected, please cancel select one." buttons {"Cancel", "Continue"} default button 2
display dialog "Enter text to use a delimiter between the track properties:" default answer delimiter_character
set this_text to the text returned of the result
if this_text is not "" then
set the delimiter_character to this_text
exit repeat
end if
end repeat
--check to see if iTunes has a browser window open
if the (count of browser windows) is not greater than or equal to 1 then
error "No browser window is open in iTunes."
end if
--the playlist currently selected is the one that will be copied
set this_playlist to the view of browser window 1
set this_name to (the name of this_playlist) as text
-- let the user choose the order of the information
display dialog "Select the order in which you would like information to be displayed" & return & return & ¬
"Summary type: " & summary_type buttons {"Cancel", "Set Prefs", "Continue"} default button 3
if the button returned of the result is "Set prefs" then
set this_choice to (choose from list summary_options with prompt "Pick the format style:") as text
if this_choice is "false" then
-- do nothing
else
set the summary_type to this_choice
end if
end if
if the summary_type is item 1 of the summary_options then
--loop through each track and retrieve song title, artist, album and time information
set the playlist_count to the count of tracks of this_playlist
set playlist_data to {}
tell this_playlist
repeat with i from 1 to the count of tracks
tell track i
set the end of the playlist_data to {artist, delimiter_character, album, delimiter_character, name, delimiter_character, time, return}
end tell
end repeat
end tell
else if the summary_type is item 2 of the summary_options then
--loop through each track and retrieve song title, artist, album and time information
set the playlist_count to the count of tracks of this_playlist
set playlist_data to {}
tell this_playlist
repeat with i from 1 to the count of tracks
tell track i
set the end of the playlist_data to {album, delimiter_character, artist, delimiter_character, name, delimiter_character, time, return}
end tell
end repeat
end tell
else if the summary_type is item 3 of the summary_options then
--loop through each track and retrieve song title, artist, album and time information
set the playlist_count to the count of tracks of this_playlist
set playlist_data to {}
tell this_playlist
repeat with i from 1 to the count of tracks
tell track i
set the end of the playlist_data to {name, delimiter_character, artist, delimiter_character, album, delimiter_character, time, return}
end tell
end repeat
end tell
else if the summary_type is item 4 of the summary_options then
--loop through each track and retrieve song title, artist, album and time information
set the playlist_count to the count of tracks of this_playlist
set playlist_data to {}
tell this_playlist
repeat with i from 1 to the count of tracks
tell track i
set the end of the playlist_data to {genre, delimiter_character, album, delimiter_character, artist, delimiter_character, name, return}
end tell
end repeat
end tell
else if the summary_type is item 5 of the summary_options then
--loop through each track and retrieve song title, artist, album and time information
set the playlist_count to the count of tracks of this_playlist
set playlist_data to {}
tell this_playlist
repeat with i from 1 to the count of tracks
tell track i
set the end of the playlist_data to {time, delimiter_character, name, delimiter_character, artist, delimiter_character, album, return}
end tell
end repeat
end tell
else if the summary_type is item 6 of the summary_options then
--loop through each track and retrieve song title, artist, album and time information
set the playlist_count to the count of tracks of this_playlist
set playlist_data to {}
tell this_playlist
repeat with i from 1 to the count of tracks
tell track i
set the end of the playlist_data to {name, delimiter_character, artist, return}
end tell
end repeat
end tell
else if the summary_type is item 7 of the summary_options then
--loop through each track and retrieve song title, artist, album and time information
set the playlist_count to the count of tracks of this_playlist
set playlist_data to {}
tell this_playlist
repeat with i from 1 to the count of tracks
tell track i
set the end of the playlist_data to {name, return}
end tell
end repeat
end tell
end if
end tell
--open Finder and plop the data in playlist_data as a string into the clipboard
tell application "Finder"
activate
try
display dialog "The playlist information has been copied to the clipboard" buttons {"OK"}
end try
set the clipboard to (playlist_data) as text
end tell