Music playing
Peachpit TV
Mac Automation Made Simple with Ben Waldie
Female: Welcome to Mac Automation Made Simple. This series focuses on providing tips and trick for using AppleScript and Automator in Mac OS X.
Ben Waldie: Hi, and welcome back to Mac Automation Made Simple. I am your host Ben Waldie. For the past two episodes, we have discussed recording and playing back manual tasks in both AppleScript and Automator. Recording is useful when you cannot find an Automator action to do what you need or you are not familiar or comfortable enough with AppleScript to try writing a script of your own.
Well, this is a good time to explore some third-party utilities for automating key strokes in mouse clicks as well. You are not just limited to AppleScript and Automator. In this episode, we will take a look at iKey. iKey is available for $30.00 from script software with a 30-day fully functional demonstration version available for download. With iKey, you begin by creating what is known as a shortcut, which consist of a series of actions that can run to perform different tasks, kind of like building an Automator workflow.
Since there are no pages Automator action at this time, in episode two, I demonstrated how to use recording in Automator to export a pages document to the desktop in PDF format. Let us try to accomplish the same thing using iKey.
Once installed, the iKey engine runs as a background application on your Mac and you can open the iKey editor from the iKey menu to create shortcuts.
[Demo]
I will begin by clicking the Create button to create a new shortcut. First, I will name my shortcut, Export Pages Doc as PDF. Next, I will begin by adding some actions to the shortcut. First, I will need to bring pages to the front. So I will select Application, Switch to Application from the commands menu.
[Demo]
Then I will choose Pages and click OK and the action is added to my shortcut.
[Demo]
Next, I will choose Menu, select menu item from the commands menu then I will click this button to choose my application pages and I will click OK. Pages brought to the front and I can select my menu item. I will choose File Export. iKey comes back to the front and I will click OK.
[Demo]
Let me bring pages back to the front. As you can see, the next step is to click the default Next button. To do this, I will go back in the iKey and I will choose Keyboard Type Keys. Since I can select the default button with the return key, I will push Return and I will click OK.
[Demo]
Let me go back in the pages.
[Demo]
The next thing that I will need to do is make sure that I am always out putting to the desktop. The key command, command D will do just this. So let me go back into iKey and this time I will choose Keyboard Type Keys again from the commands menu, and this time, I will type command D. You can see that the command modifier key becomes selected. And then I will click OK. Let me go back in the pages one more time.
[Demo]
And you can see that the Export button is the default button. So, I am going to go back in the iKey and I am going to choose Keyboard Type Key and I am going to push Return again then I will click OK. So now, my shortcut is complete, let us test it.
First, I am going back to pages and I cancel the Export dialog. Now, I will return to iKey and I click the Test button.
[Demo]
As you can see, the test to perform and my document is exported to the desktop in PDF format. Once you have created a shortcut in iKey, you can configure it to run in lots of different ways. For example, you can configure a shortcut to run automatically when an application is launched, quit or brought to the front, or you configure it to run on a schedule, such as at a certain time of day. You can even configure it to run from one of your mass buttons or from a menu in the menu bar. And of course, this is iKey, so you can give it a key command. That is what I am going to do here.
Let me go back to pages. If I look in the file menu, you can see that the Export menu does not have a key command assigned. So I am going to assign a key command of command E to my export shortcut.
[Demo]
First, I will need to specify a context for running my shortcut. Since this shortcut works with pages, I only want it to be run when pages is in the front. So from the Context menu, I will choose Application in Front.
[Demo]
I will choose pages from the list and I click OK. Then, I remove Universal from the list of Contexts. Next, I will assign my key command. From the Launchers menu, I will choose Keyboard Event then I will type my key command, command E and I will click OK. Now, I close my shortcut and I will quit the iKey editor, and then I delete the PDF that I previously created from my desktop. Then I will go into pages and I will type command E.
[Demo]
As you can see, my shortcut runs and my PDF is exported to the desktop.
[Demo]
I have really only scratched the surface of what is possible with iKey, and I encourage to download the demo version from the script software website and give it a try for your self. Although Automator has the ability to record and play back key strokes and mouse clicks for free, it certainly has some limitations and sometimes you may run into a brick wall. In this situations, a utility such as iKey can provide you with a quick easy and reliable work around.
This, along with its other useful features, will no doubt make iKey an excellent tool for anyone looking to implement automation in their workflow. I am also pleased to say that iKey will allow you to run and AppleScript from your shortcut. iKey is also AppleScriptable allowing it to be easily integrated into a larger automotive workflow.
Thanks for joining me for this episode of Mac Automation Made Simple. Until next time, automate your Mac and simplify your life.
Music Playing
Transcription by:
Scribe4you Transcription Services