Re: iTunes 4 & Artwork scripting
Re: iTunes 4 & Artwork scripting
- Subject: Re: iTunes 4 & Artwork scripting
- From: Christian Mittendorf <email@hidden>
- Date: Thu, 8 May 2003 17:23:54 +0200
You are using
set imgfile to "Macintosh HD:Users:dcox:base.pict" as text
Have you tried to write your file using "as picture" parameter?
So instead use:
set imgfile to "Macintosh HD:Users:dcox:base.pict" as picture
Otherwise I'm not sure if a picture written with this command is
readable by commandline tools because the immage information might
be stored in the resource fork of the file instead of the data
fork. And those cli tools that you mention cannot handle pictures
that use resorce forks. However, I'm not sure about this last issue.
cu
cm
On Donnerstag, Mai 8, 2003, at 04:18 Uhr, David A. Cox wrote:
This was very helpful to me in starting to play with some things, but
I am
still a bit stuck.
Basicaly, I want to pull the frontmost artwork from the current track
in
itunes, and then fiddle with the file. I have it set up so that I can
pull
the image out of itunes, and save it to a temp location on the disk,
but
the file still seems "odd" in many ways. If I give the file a *.pict
file
name, I can always open it in Safari, and it will often open in Preview
(but not always). If I try to manipulate the image with any of the
command
line tool included in a package called imagemagic, it gives me an
error to
the effect that a file name is missing (this seems to be from parsing
the
image file itself). The file also reports in the finder as a text
file, no
matter what extension I put on it.
Any thoughts would be of help, as I am rather stuck. The script that I
am
using to save a copy of the image to a temp file is (but note that
Photoshop will not open the same file):
tell application "iTunes"
if artworks of current track exists then
set imgdata to front artwork of current track
set img to (data of imgdata) as picture
tell application "Finder"
set imgfile to "Macintosh HD:Users:dcox:base.pict" as text
open for access alias imgfile with write
permission
write (img as picture) to alias imgfile
close access alias imgfile
tell application "Safari"
open imgfile as alias
end tell
end tell
end if
end tell
DAC
On Thu, 1 May 2003, Doug Adams wrote:
So far, we can grab the art and put it in the clipboard:
tell application "iTunes"
set myP to view of front window
if selection exists then
set c to (item 1 of index of selection)
tell myP
if artworks of track c exists then
set pic to data of the artworks of track c as picture
set the clipboard to pic
return clipboard info
end if
end tell
end if -- selection
end tell
A script that copied one track's artwork to all others in the playlist
would be cool. All help appreciated.
--
Doug Adams
email@hidden
iTuners! Get Some AppleScripts!
Doug's AppleScripts for iTunes
<malcolmadams.com/itunes/>
RSS feed:
<malcolmadams.com/itunes/dougs.rss>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.