Re: Save image from raw data class variable
Re: Save image from raw data class variable
- Subject: Re: Save image from raw data class variable
- From: jj <email@hidden>
- Date: Thu, 17 Mar 2005 12:09:40 +0100
> I getting a track artwork from iTunes as <<data
> PICT36D40...bla-bla-bla...>> and I need to save it in file.
> How I can do that? Does exists any solutions with a shell commands or
> an additions?
>
>
> Aha-pupok
> email@hidden
> http://www.yezhe.ru/applescript/
You can simply write the data to a PICT file. Eg:
#################
--> grab artwork
tell application "iTunes" to ¬
set pictData to data of artwork 1 of track 1 of playlist 1
--> choose output file
set outputFile to (choose file name default name "artwork.pict")
--> create file from shell, so it borns without file/creator type
--> and it is mapped automatically to the default-app-for-pict-files
do shell script "touch " & quoted form of POSIX path of outputFile
--> write raw data
set fref to (open for access outputFile with write permission)
set eof of fref to 0 --> empty file if needed
write pictData to fref
close access fref
#################
jj
--
http://www.macscripter.net/
http://www.osaxen.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden