Save the clipboard picture to a file using image events
Save the clipboard picture to a file using image events
- Subject: Save the clipboard picture to a file using image events
- From: MÁTYÁS Ferenc Farkas <email@hidden>
- Date: Tue, 28 Jun 2005 00:00:07 +0200
Dear List,
I have a picture on my clipboard, in the Finder I can see the picture
on the Show Clipboard it says, that it contains a picture, it could
be vector and pixel based, and I'd like to save it as a jpg file on a
specified folder. Using Preview.app it works, but Preview is not
scriptable, using Image Events I've get the following error,
set furl to (path to home folder as string) & "picture001.pict" as
string as «class furl»
tell application "Image Events"
set a to the clipboard
save a as PICT in furl
end tell
Script “untitled 5” started
tell current application
path to home folder as string
--> "ffdata:ffhome:"
end tell
tell application "Image Events"
the clipboard
--> «data PICT8B42000000000 [...]
0140000002E000400000000002801980271012000FF» as PICT in file
"ffdata:ffhome:picture001.pict"
end tell
Script “untitled 5” finished
--> Image Events got an error: Can't make «data
PICT8B4200000000000096[...]801980271012000FF» into type image.
Using another approach I've get only a text file with junk text in it.
set furl to (path to desktop folder as string) & ":pic.pict" as
string as «class furl»
set openfile to open for access furl with write permission
try
set thedata to the clipboard
write (thedata as picture) starting at 0 to openfile
close access openfile
on error errmsg
close access openfile
end try
Is there a way to do that? I looked at Automator, but it has only a
copy to clipboard option. In the pbpaste likes only eps. Thank you.
--
Regards,
MÁTYÁS Ferenc Farkas
_______________________________________________
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