Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better sample applescript for screenshots #666

Closed
cyberduck opened this issue Aug 14, 2006 · 1 comment
Closed

better sample applescript for screenshots #666

cyberduck opened this issue Aug 14, 2006 · 1 comment

Comments

@cyberduck
Copy link
Collaborator

cyberduck commented Aug 14, 2006

court3nay created the issue

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
@cyberduck
Copy link
Collaborator Author

cyberduck commented Sep 6, 2006

@dkocher commented

As of 0e0e8ed.

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants