Mein erstes EyeTV Skript

Dieses Eye-TV Skript schaut nach, ob die in EyeTV ausgewählten Aufnahmen in ~/iTunes/iTunes Music/TV Shows bereits exportiert wurden (iPod m4v). Trifft dies zu, wird eine Zusammenfassung der Aufnahme als Textdatei in diesem Ordner erzeugt, die Exportierte Datei entsprechend
umbenannt und anschließend wird die Aufnahme aus Eye-TV GELÖSCHT. Ok den Part habe ich sicherheitshalber mal auskommentiert.So könnte man aber stumpf in EyeTV alle Aufnahmen auswählen, das Skript laufen lassen und das Skript "bereinigt" automatisch die Aufnahmeliste =)

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

Dies 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

This entry was posted in EyeTV and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

4 Comments

  1. Posted October 19, 2008 at 6:04 pm | Permalink

    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

  2. hubi
    Posted October 19, 2008 at 10:59 pm | Permalink

    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....

  3. Thilo
    Posted November 16, 2010 at 2:34 pm | Permalink

    Hallo,
    hast du eine Idee, wie man eine eyeTV Aufnahme mit dem recordingdone script so umbenennen kann, dass Plex was damit anfangen kann. Also am besten im Format "Titel (Jahr)".

  4. hubi
    Posted November 20, 2010 at 2:27 am | Permalink

    Ich frage mich welche Datei Plex da wiedergeben soll... die original Aufnahme (mpeg2-Stream) oder wandelst Du die Filme erst anschließen mit EyeTV um und möchtest diese umbenennen?
    Ich nutze weder Plex noch noch EyeTV, deshalb die Frage…

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA:


two × = 16

Subscribe without commenting

  • Seite übersetzen:


    Paypal for Pizza:




  • Kategorien


  • Letzte Kommentare

    • Niklas: Vielen Vielen Dank! So klappt es!
    • hubi: Servus Niklas, ich habe mir den Quellcode noch einmal angesehen und habe nun unter 10.7.3 einen Weg gefunden...
    • Niklas: Klingt super das Script. Leider bekomm ich immer folgende Fehlermeldung: error “„Mail“ hat einen Fehler...
    • Jürgen: Hallo Hubi, beim Abfragen von Kennworten gibt es noch eine böse Falle: Das Format, in dem security antwortet,...
    • hubi: Am einfachsten Du öffnest im AppleScript-Editor mal das Funktionsverzeichnis (unter Ablage) von iTunes. Ein...