Cyberduck Mountain Duck CLI

#666 closed enhancement (fixed)

better sample applescript for screenshots

Reported by: court3nay Owned by: dkocher
Priority: normal Milestone: 2.6.2
Component: documentation Version: 2.6
Severity: normal Keywords:
Cc: Architecture:
Platform:

Description

modifications:

  1. saves the snapshot as png initially so you don't have to convert from pdf
  2. tells cyberduck to close the window, NOT quit the whole app (duh!)

Here's the relevant section

-- take the screenshot
delay 1.5
do shell script "/usr/sbin/screencapture -tpng " & image_location & ".png"

-- do the image stuffs
try
	tell application "Image Events"
		launch
		-- get the image from the clipboard
		set the_image to open image_location & ".png"
		-- resize image for thumb
		scale the_image to size 133
		-- save the thumb as png
		save the_image as PNG in thumb_location & ".thumb.png"
		close the_image
	end tell
on error error_message
	display dialog error_message
end try
-- upload the image and thumbs with Cyberduck
try
	tell application "Cyberduck"
		activate
		set theBrowser to (make new browser)
		try
			tell (theBrowser)
				set encoding to "UTF-8"
				connect to theServer with protocol theProtocol as user theUser with initial folder theRemoteFolder
				upload file image_location & ".png"
				upload file thumb_location & ".thumb.png"
				disconnect
				close
			end tell
		on error error_message
			display dialog error_message
		end try
		-- quit
	end tell
on error error_message
	display dialog error_message
end try

Change History (2)

comment:1 Changed on Aug 26, 2006 at 1:17:28 PM by dkocher

  • Milestone set to 2.6.2
  • Status changed from new to assigned

comment:2 Changed on Sep 6, 2006 at 8:17:36 AM by dkocher

  • Resolution set to fixed
  • Status changed from assigned to closed

As of r2384.

Note: See TracTickets for help on using tickets.
swiss made software