I have used this for few things:
This could come in useful in many situations.
Nice use of AppleScript to enhance Reminders: Enhancing Reminders with AppleScript and Macros.
open command in Terminal is very powerful.
You cant just open files and folders in Finder. You can type
to open a webpage in your default browser. Or
To open a Screen Sharing session to a remote computer.
Simple and (should have been obvious):
I have been using this in some cases but I did not know about the -t option.
The previous post reminded of one of the oldest scripts I have and still use regularly. I regularly have to gather information found on different webpages and email them to somebody. I try to gather all the relevant webpages in tabs in one Safari and then run this script. It will look at all the tabs in the frontmost Safari Window and build a plain text list out of the titles and links and place that in clipboard, ready to paste into an email or elsewhere.The result will look like this:
Apple <http://www.apple.com/> Google <http://www.google.com/> Scripting OS X | #! is not a curse word <http://scriptingosx.com/>
The script is fairly straightforward:
global linkText on run set linkText to "" tell application "Safari" activate set w to window 1 set n to 0 try -- this will fail for the downloads window set n to count tabs of w end try if n > 1 then repeat with t in every tab of w my appendLineWithDoc(t) end repeat else if n = 1 then my appendLineWithDoc(document of w) end if end tell set the clipboard to linkText return linkText end run on appendLineWithDoc(theDoc) tell application "Safari" tell theDoc try set linkText to linkText & name set linkText to linkText & return & "<" & URL & ">" & return & return end try end tell end tell end appendLineWithDoc
You can save this script in your ~/Library/Scripts/Applications/Safari folder and enable the Script menu and it will be shown only in Safari.
This could be a very useful script for other tools as well: