Write image data to file
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.netCheck 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