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

Write image data to file


  • Subject: Write image data to file
  • From: Jesse Almanrode - JA Computing <email@hidden>
  • Date: Tue, 9 Mar 2010 09:24:20 -0700

I am looking to write image data to a file using applescript. A similar script that I have found that does this (but doesn't appear to work anymore) is iTunes Artwork to Preview from Doug's Scripts.  Does anyone have any expertise with this? 

As a test I was writing my own version of the aforementioned script. It does write the data to a file but no application opens it as a valid picture. I have included it below.


tell application "iTunes"

set playingTrack to current track

set trackArtwork to artwork 1 of playingTrack

set imageData to data of trackArtwork as picture

set blankFile to (path to desktop as string) & "picture.pict"

set fileReference to (open for access blankFile with write permission)

write imageData starting at 0 to fileReference

close access fileReference

end tell

tell application "Preview"

activate

open blankFile

end tell


---<O><O><O>---
Jesse Almanrode
Webmaster/Netcaster
www.jacomputing.net

Check out the iScript Netcast on iTunes
 _______________________________________________
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

  • Prev by Date: Re: multi input form
  • Next by Date: Re: Write image data to file
  • Previous by thread: KosmicTask 1.0 released
  • Next by thread: Re: Write image data to file
  • Index(es):
    • Date
    • Thread