Snow schrieb:
@lengsel
Die Metric Conversions Osax ist von 1997 - also mit Sicherheit nur bis OS 9 nutzbar.
Oh, das ist mir wohl entgangen.
Unter OS X brauchst du sie unter Umständen gar nicht.
Einfach mal munter drauflos probieren.
Danke für die Beispiele, werd ich probieren.
Hauptsächlich wollte ich Zeiten umrechnen.
Und weil ich gerade fertig geworden bin damit, hier noch Code aus zwei Skripten die ich verändert habe um die Songs in iTunes hübsch anzuzeigen.
Vielleicht gefällt es ja auch dem einen oder anderen.
Einziges Problem ist dass sich das Icon nicht ändert wenn es zu einem Song kein Artwork gibt. Dann bekommt man immer noch das vom letzten Song mit Artwork zu sehen. Schick wäre da sowas wie ein Standardicon...
====================================
(*
Dieses Script ist aus leicht veränderten Versionen der Skripte
"Save Artwork to Folder" (Credits siehe unten) und "iTunes Bezel"
(
http://www.macosxhints.com/article.php?story=20040810091734861&query=bezel)
entstanden. Mit Sicherheit lassen sich die Veränderungen am Code die ich
vorgenommen habe auch eleganter lösen, aber für meine Problemlösung reicht es aus.
Flo Gründel (
flo@florian-gruendel.de)
"Save Artwork To Folder" for iTunes
written by Doug Adams
dougadams@mac.com
Thanks to Olivier Hericord for main routines!
v1.0 june 6 04
- initial release
Get more free AppleScripts and info on writing your own
at Doug's AppleScripts for iTunes
*)
tell application "iTunes"
if selection is not {} and (count items of selection) is 1 then
set theTrack to item 1 of selection
else
my alert_user_and_cancel("Please select one track.")
end if
if class of theTrack is not file track or artworks of theTrack is {} then
my alert_user_and_cancel("The selected track does not contain Artwork.")
end if
set artworkFolder to (("Macintosh HD:Users:USERNAME:Library:Application Support:LanOSD:icons:") as string)
try
set artworkData to (data of artwork 1 of theTrack) as picture
set artworkFormat to (format of artwork 1 of theTrack) as string
if artworkFormat contains "JPEG" then
set extension to ".jpg"
else if artworkFormat contains "PNG" then
set extension to ".png"
end if
set theName to ("icon-music")
set tempartworkFile to (artworkFolder & "temp" & extension) as string
set finalartworkFile to (artworkFolder & theName & extension) as string
set file_reference to (open for access tempartworkFile write permission 1)
write artworkData starting at 0 to file_reference as picture
close access file_reference
do shell script "cd " & quoted form of (POSIX path of artworkFolder) & ¬
";tail -c+223 " & quoted form of ("temp" & extension) & "> " & ¬
quoted form of (theName & extension) & ";rm " & ¬
quoted form of ("temp" & extension)
on error errM
close access file_reference
my alert_user_and_cancel("Unable to export Artwork from the selected track." & ¬
return & return & errM)
end try
end tell
to alert_user_and_cancel(message)
tell application "iTunes" to display dialog message buttons {"Cancel"} ¬
default button 1 with icon 0
end alert_user_and_cancel
tell application "System Events" to set doit to (exists process "iTunes")
tell application "iTunes" to set doit to doit and not (minimized of first EQ window)
tell application "iTunes" to set doit to doit and (player state is playing)
if doit then
tell application "iTunes"
set trk_arts to the artist of the current track
set trk_name to the name of the current track
set trk_albm to the album of the current track
end tell
tell application "LanOSD"
message kind "itunes-song" text trk_arts fade delay 10 over 1 quadrant 6 icon "music"
message kind "itunes-song" text trk_name fade delay 10 over 2
message kind "itunes-song" text "From \"" & trk_albm & "\"" fade delay 10 over 3
end tell
end if
================================
Grüße,
Flo
P.S.: Ist eigentlich schon mal jemandem aufgefallen dass sich diese Pfefferschoten pepp /Gurken banana /wie auch immer-Smileys nahezu exakt zu "She was" von den Talking Heads bewegen? (Kleines bisschen zu schnell, aber doch irgendwie passend) Wenn das mal kein Zufall ist....