Posterous theme by Cory Watilo

Filed under: Scripts

Auto-enable Safari's "Reopen Last Session"

One of the main reasons I used Firefox over Safari was the ability for FF to remember my tabs and windows once I quit the application. Since the release of Safari 4 however, I am finding it to be much smoother and faster than FF and have moved to it exclusively. The problem still remains that users are not able to have the browser launch directly into the previous sessions so I decided to stop complaining and write an AppleScript to solve the problem. The first thing you need to do is "Enable access for assistive devices" which is located in the System Preferences under Universal Access. Then just run this application anytime you want Safari to open your last sessions (prior to quitting the application). If you would prefer to create the script yourself simply open Script Editor and enter the following text:
tell application "Safari"

activate

end tell

tell application "System Events"

 tell process "Safari"

 tell menu bar 1

 tell menu bar item "History"

 tell menu "History"

 click menu item "Reopen All Windows from Last Session"

 end tell

 end tell

 end tell

 end tell

end tell
Then save the script as an application and your good to go. If you want to change the icon so it looks like Safari simply "Get Info" for the application and drag the Safari (or any other) image to the icon preview  (top left) in the inspector window.

How-To: Add Meta Data to JPEG’s with Automator

Media_httpwwwautomatoractionscomimagesottopng_hbiefvnmfxrtcac

Recently I started working my way through Automator and AppleScript in an attempt at mastering my computer.  Since starting I’ve realized that it will take quite a while to get to where Sal Soghoian is but I think it’ll be worth the ride.  Through this process I plan to post some of the more popular examples and my own personal scripts and exercises.

This first example is an Automator workflow that makes it easy to add meta data to a handful of JPEG files at a time.

  1. Download the Automator script (Edit JPEG Meta Data.zip)
  2. Unzip the file
  3. Select one or multiple JPEGs
  4. Drag the selected files to the newly downloaded Automator app

     

    Media_httpwwwjustinwahkancomwpcontentuploads200903autodragjpg_vrejewlazgdhfft
    • A Finder window will open showing the selected JPEGs so you can see which JPEG you are adding meta data to
    • Another Dialogue window will open where you can add the meta tags
      Media_httpwwwjustinwahkancomwpcontentuploads200903picture2png_hskdkwnnwauvccg
  5. Add the meta data you wish into the dialogue window (Note: The data you add will be searchable through Spotlight so feel free to add various keywords)
  6. Once you have added the appropriate tags click Continue
  7. In the Finder window the next file will be selected which you can now add meta data for
  8. If you selected more JPEGs than you have the patience to tag just hit cancel and select a smaller group and start again
  9. To check that your tags have been added select a JPEG and click “Get Info” or ‘cmd + i”

This tutorial was features in the Macbreak Dev podcast.  This is the first of many scripts I hope to learn and share.  Enjoy.