using application dictionary parameters in paparazzi

I’m using paparazzi to take a picture of a web page. I used the record function to create this script.

tell application "Paparazzi!"
	activate
	tell application "System Events"
		keystroke return
		delay 10
		keystroke "s" using command down
		keystroke tab
		keystroke "paparimage"
		delay 2
		keystroke tab
		keystroke tab
		key code 125
		keystroke return
		delay 1
		keystroke return
		keystroke "q" using command down
		
	end tell
end tell

but I’d like to learn how to do this with the dictionary and built in commands.
so far I have this

tell application "Paparazzi!"
	activate
	set minsize to {860, 625}
	capture  "http://www.wpr.org/book/lastweek.html" minsize
	save ttbook1 as JPEG in "HD:Users:user:Music:Audio Hijack:paparimage:ttbookedit:"
end tell

The capture worked fine but I’d like to use the optional parameter for min size

capture‚v : Captures an URL.
capture Unicode text : The URL to capture.
[crop size list] : The crop size, as {width, height}.
[delay small real] : Delay between load and capture, in seconds.
[min size list] : The minimum size, as {width, height}.

I also wanted to use save as jpeg but I think my filepath is wrong.
I have searched for information on parameters but I can’t find an example using one.

save‚v : Saves the captured image. Returns true on success.
save [anything] : The image to save. Will use the main window’s image if not specified. (Not yet implemented.)
as JPEG/PDF/PNG/TIFF : The save format.
in alias : Where to save the image.
[icon boolean] : Save a thumbnail icon? (Default false.)
[quality small real] : The save quality from 0.0 to 1.0; only applies to JPEG. Defaults to 1.0.
→ boolean

Hi,

To my mind the scripting support in Paparazzi is a bit odd, but I think this will do what you want.

tell application "Paparazzi!"
	activate
	set minsize to {860, 625}
	set filename to "ttbook1.jpg"
	capture "http://www.wpr.org/book/lastweek.html" min size minsize
	repeat while busy
		-- To wait until the page is loaded.
	end repeat
	save as JPEG in "HD:Users:user:Music:Audio Hijack:paparimage:ttbookedit:" & filename
end tell

Did you look at the example script that (I think) came with the application?

Best wishes

John M

Thanks John,
I added a few modifactions now and it works great. This is the current script

tell application "Paparazzi!"
	activate
	set minsize to {859, 625}
	set filename to "ttbookpic1.jpg"
	set iconame to (true)
	capture "http://www.wpr.org/book/lastweek.html" min size minsize
	repeat while busy
		-- To wait until the page is loaded.
	end repeat
	save as JPEG in "Macintosh HD:Users:username:desktop:temp files:" & filename icon iconame
	quit application "Paparazzi!"
end tell

I just have a few more questions. If I would also like to use this file in the next part. What would I do to assign it to a variable so I could pass it on outside of the end tell?
I couldn’t find a sample script in the paparazzi program folder. Is that where it should be?

Moving to Automator from Automator Scriplets

Hi alcatrazp,

I suppose it depends on what you want to do with it. What do you want to do with the file?

John M

I was going to try to use the automator action “propper cropper” to crop the image.
http://turtlehead.co.uk/macintosh-toys/osx-tiger-automator-propper-cropper/

You need to return the full file path as alias.

In the Applescript action there is a line that says “return input”. Replace this with:

return alias "Macintosh HD:Users:username:desktop:temp files:ttbookpic1.jpg"

This will pass the path to the image file to your next action.

John M