Re: How to access raw data (as seen in chevron syntax)
Re: How to access raw data (as seen in chevron syntax)
- Subject: Re: How to access raw data (as seen in chevron syntax)
- From: Shane Stanley <email@hidden>
- Date: Sat, 03 Jul 2010 09:24:39 +1000
- Thread-topic: How to access raw data (as seen in chevron syntax)
On 3/7/10 7:51 AM, "Matthew Strange" <email@hidden> wrote:
> All the more pressure for me to get these PICTs out to files so they
> can be converted to something else!
>
> Actually, I solved my immediate problem with GraphicConverter -- that
> has a nice command for making a picture from clipboard data, which
> can then be saved in whatever format is preferred.
If you're going via the clipboard, the data is likely to be available in
other formats, as well as PICT.
> (This is why it would be nice to be able to read the bytes in the
> data -- you could then learn the dimensions of the image and write
> the correct info into the header. But I digress.)
While we're digressing, if you're on 10.6 and you want to try
AppleScriptObjC, you can get the dimensions easily enough:
set pb to current application's NSPasteboard's generalPasteboard()
set thePic to current application's NSImageRep's imageRepWithPasteboard_(pb)
set theHeight to thePic's pixelsHigh() as integer
set theWidth to thePic's pixelsWide() as integer
You can also save the contents to something like TIFF:
set pb to current application's NSPasteboard's generalPasteboard()
set thePic to current application's NSImageRep's imageRepWithPasteboard_(pb)
set theData to thePic's representationUsingType_properties_(current
application's NSTIFFFileType, missing value)
tell theData to writeToFile_atomically_("/Test.tiff", true)
--
Shane Stanley <email@hidden>
_______________________________________________
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