Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.6: Rename screenshots with Automator and AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Rename screenshots with Automator and AppleScript
Authored by: mark hunte on Dec 08, '09 04:43:34PM
As a Quick example, using a hotkey app.
there is no need to change the name of the file after it has been created, You can set the name before you
do the screen capture.
The script below will ask for the folder you want to save to, the name of the captured file and delay to when the capture is taken.
I have set the format here as jpg.

As I said a quick example, no checking if file exist, and other stuff that could be added.


tell me to set thePath to (choose folder)
set thePath to (POSIX path of thePath)
set format to "jpg"
       set defAns to "." & format as string
tell me to display dialog thePath default answer defAns buttons {"Cancel", "OK "} default button 2
  copy the result as list to {text_returned, button_pressed}
tell me to (display dialog "set Delay" default answer 2 buttons {"Cancel", "OK "} default button 2)
  copy the result as list to {text_returned2, button_pressed2}
 set Delay_ to text_returned2 as number
 delay Delay_
set doit to do shell script ("screencapture   -t" & format & space & (POSIX path of thePath) & text_returned as string)
 
---
mh


[ Reply to This | # ]
10.6: Rename screenshots with Automator and AppleScript
Authored by: llee on Feb 01, '10 07:49:30AM
The only problem I see with that is that you have to replace or supplement the OS X default shortcuts with equivalents using either the same or different shortcuts that employ your script. (I know it's possible, I already do it with command-f.)The default screen shot shortcuts offer quite a bit of varied functionality, and I think it would be quite an exercise to duplicate it all just to employ a script. I think the folder action provides a better compromise.

[ Reply to This | # ]