Mein erstes EyeTV Skript
tell application "EyeTV"
set these_r to selection of programs window
end tell
set thepath to do shell script "echo $HOME" & "/Music/iTunes/iTunes Music/TV Shows/"
repeat with this_r in these_r
tell application "EyeTV"
try
set this_year to (last word of (episode of this_r as text)) as integer
set theepisode to episode of this_r
on error
set this_year to 0
end try
set is_busy to busy of this_r
set the_contents to description of this_r as text
set the_name to (title of this_r) as text
set the_info to episode of this_r
end tell
try
set theepisode to replace_chars(theepisode, ":", "_")
set theepisode to replace_chars(theepisode, "/", "_")
end try
set the_name_ to replace_chars(the_name, ":", "_")
if is_busy = false then
if this_year is not 0 then
set the clipboard to the_name & " (" & this_year & ")" & return & return & the_info & return & return & the_contents as text
try
do shell script "mv " & quoted form of (thepath & the_name_ & "/" & theepisode & ".m4v") & " " & quoted form of thepath & quoted form of ("(" & this_year & ") ") & quoted form of the_name_ & ".m4v"
do shell script "pbpaste | cat>" & quoted form of thepath & quoted form of ("(" & this_year & ") ") & quoted form of the_name_ & ".txt"
(** tell application "EyeTV"
delete this_r
end tell**)
on error msg
--display dialog the_name_ & " gibt es anscheinend nicht."
end try
else
set the clipboard to the_name & return & return & the_info & return & return & the_contents as text
try
do shell script "mv " & quoted form of (thepath & the_name_ & "/" & theepisode & ".m4v") & " " & quoted form of thepath & quoted form of ("(" & this_year & ") ") & quoted form of the_name_ & ".m4v"
do shell script "pbpaste | cat>" & quoted form of thepath & quoted form of the_name_ & ".txt"
(** tell application "EyeTV"
delete this_r
end tell
**)
on error
--display dialog the_name_ & " gibt es anscheinend nicht."
end try
end if
end if
end repeat
on replace_chars(this_text, search_string, replacement_string)
if this_text contains the search_string then
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
end if
return this_text
end replace_chars
Update
Die ist ein Beispiel, wie man die Original-EyTV-Aufnahme kopieren könnte...
tell application "EyeTV"
set these_r to selection of programs window
repeat with this_r in these_r
set this_location to location of this_r as text
set AppleScript's text item delimiters to ":"
set this_location to text items 1 through -2 of this_location as text
set AppleScript's text item delimiters to ""
set this_location to ((this_location & ":") as text) as alias
tell application "Finder"
activate
duplicate this_location to (choose folder)
end tell
end repeat
end tell
Ähnliche Themen
Comments
Comment from hubi
Time October 19, 2008 at 10:59 pm
Ich hab' da mal ein 2. Code-Beispiel geschrieben. Der Teil in der Repeat -Schleife Tut das, was Du möchtest... na ja, er kopiert er bewegt (move) es nicht....
Comment from Robert Reinke
Time October 19, 2008 at 6:04 pm
Aloha,
dieses Script ist ja genial. Besteht die Chance, von Dir das so angepasst zu erhalten, dass das Script statt des löschens ein verschieben der EyeTv-Datei auf einen anderen Datenträger (bspw. NAS) durchführt?
Also wenn Datei bereits in iTunes exportiert ist, dann verschiebe Datei nach .... (hier sollte dann Finderdialog aufgehen zur Angabe des Zielortes.
Ich bin einfach zu begrenzt in meinen Applescriptkenntnissen um die entsprechenden Codezeilen in das vorhandene Script einzubauen.
Danke vorab für Deine Hilfe,
Gruß Robert