Skip to content

Instantly share code, notes, and snippets.

@cspickert
Created December 17, 2010 21:25
Show Gist options
  • Save cspickert/745730 to your computer and use it in GitHub Desktop.
Save cspickert/745730 to your computer and use it in GitHub Desktop.
A simple AppleScript for use with Chrome for Mac and the Chrome for a Cause extension.
-------------------------------------------------------------------------------
-- This is a simple AppleScript for use with Google Chrome (Chrome.app) and the
-- [Chrome for a Cause extension](http://bit.ly/gU4eQS). It will open a new tab
-- and then close it after a 1 second delay 250 times (the daily limit for the
-- extension). See the instructions below to use.
--
-- From AppleScript Editor:
--
-- 1. Open AppleScript Editor (/Applications/Utilities/AppleScript Editor.app).
-- 2. Copy this script into the text window and click Run.
--
-- From the command line:
--
-- 1. Save this script to a file (ex. "chromeforacause.applescript").
-- 2. From Terminal ("/Applications/Utilities/Terminal.app"), run:
-- osascript chromeforacause.applescript
-------------------------------------------------------------------------------
on run argv
tell application "Google Chrome" to activate
tell application "System Events"
tell process "Google Chrome"
set file_menu to menu "File" of menu bar 1
repeat 250 times
click menu item "New Tab" of file_menu
delay 1
click menu item "Close Tab" of file_menu
end repeat
end tell
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment