Clipboard Data from PDF to JPG

Hi Everyone,

I am having a problem with the Clipboard: I wan’t the content of the clipboard to be converted from PDF to JPG File-Format. I am trying to do this with the GraphicsImporter OSAX. I guess my problem is that GraphicsImporter OSAX can’t handle data directly from the clipboard.


tell application "Finder"
	activate
	set noerror to true
	try
		set the theSourceFile to the clipboard
	on error
		set noerror to false
	end try
	if noerror is true then
		try
			set theResolution to {72, 72}
			set thebounds to {0, 0, 600, 600}
			set thequality to 0
			set thePicture to (giconvert theSourceFile type "JPEG" resolution theResolution quality thequality bounds thebounds with proportions)
			set the clipboard to thePicture
		on error
			display dialog "Error" buttons " OK"
			set noerror to false
		end try
	end if
end tell

Does anybody have an idea?

Greetings from Germany
Sebastian

Sebastian:

I have an idea, and a few questions. Is there any reason that you need to use the clipboard at all? Please see the script below; it allows you to choose a PDF file and use Image Events to save it as a JPEG on your desktop.

Let me know if this does not work for you.

set main_path to path to desktop as Unicode text
set selectedFile to (choose file)
tell application "Image Events"
	set openedFile to open (selectedFile as alias)
	save openedFile in main_path as JPEG
end tell

casdvm