• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Save image from raw data class variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Save image from raw data class variable


  • Subject: Re: Save image from raw data class variable
  • From: Kirill Kortchagin <email@hidden>
  • Date: Thu, 17 Mar 2005 15:13:03 +0300


On мар 17, 2005, at 14:09, jj wrote:

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:

#################
tell application "iTunes" to ¬
    set pictData to data of artwork 1 of track 1 of playlist 1

set outputFile to (choose file name default name "artwork.pict")

do shell script "touch " & quoted form of POSIX path of outputFile

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

Thanks! It work!
Before it I saw the JPEG signature or the PNG signature in the text of written files and I tried to save and to open it as the JPEG or PNG file respectively. ;)



Aha-pupok email@hidden http://www.yezhe.ru/applescript/


_______________________________________________ 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
  • Follow-Ups:
    • Re: Save image from raw data class variable
      • From: Brian Johnson <email@hidden>
References: 
 >Re: Save image from raw data class variable (From: jj <email@hidden>)

  • Prev by Date: Re: getting chunks of text
  • Next by Date: Re: tell a script to tend to system process for X amount of time?
  • Previous by thread: Re: Save image from raw data class variable
  • Next by thread: Re: Save image from raw data class variable
  • Index(es):
    • Date
    • Thread