• 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: Write image data to file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Write image data to file


  • Subject: Re: Write image data to file
  • From: "Stockly, Ed" <email@hidden>
  • Date: Tue, 09 Mar 2010 10:09:40 -0800
  • Thread-topic: Write image data to file

>doug> Try changing "data" to "raw data".

That works for me:


tell application "iTunes"

    set playingTrack to current track
    set trackArtwork to artwork 1 of playingTrack
    set imageData to raw data of trackArtwork
    set blankFile to (path to desktop as string) & "picture.pict"
    set fileReference to (open for access blankFile with write permission)
    set eof of blankFile to 0
    write imageData starting at 0 to fileReference
    close access fileReference
end tell

tell application "Preview"

    open blankFile
    activate

end tell


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Write image data to file (From: Doug Adams <email@hidden>)

  • Prev by Date: Re: Write image data to file
  • Next by Date: Re: Trying to open just three items at a time (Stan Cleveland)
  • Previous by thread: Re: Write image data to file
  • Next by thread: Re: Trying to open just three items at a time (Stan Cleveland)
  • Index(es):
    • Date
    • Thread