A simple use of Applescript to get PID (unix id of processes ) and kill one Application if another is not running.
But heres a better example..
Close Duplicate finder windows
Macosxhints Posted a Applescript hint on Macosxhints to close duplicate finder windows.
The idea of the script is sometimes you may find you have multiple finder windows open. Many of them leading to the same target (folder). And want a quick way of closing all the duplicate windows.
But I couldn’t understand why it was so long and complicated. So as an excise for myself wrote one that did a similar job
Get Finder window Path.
I had already wrote some code for an application that could get the path of open Finder windows.
So when I saw a member on Apple Stack Exchange wanted to get the top level finder window’s path.
I thought it would be simple to throw together something using part of the code in writing a new Automator Action.
The Action Get first Finder Window Path. Will return the Posix path of the front most open Finder window.
First download the Action
|This is for 10.9.x v103- Action is now placed in Files & Folders in the Automator library|
|This is for System : 10.8|
|This is for System : 10.6|
1, Open the zip and install it by double clicking on the action.
It will go into the Utilities Actions name ‘Get first Finder Window Path’
2, drag it as normal to the workflow area and add for example the ‘Copy to Clipboard’ action below it