How to assign a sequence of keystrokes to a Mac keyboard shortcut which can be used on the Mac or Windows side

Posted on 2015-02-14
Last Modified: 2015-03-09
Mac OSX ver 10.7.5
Parallels Desktop 9 for Mac
Windows 7 Ultimate SP1

Is there some way I can assign a series of keystrokes to a keyboard shortcut, for example:


and have this keyboard shortcut available whether I'm interacting with the Apple side of my Mac or with the Windows side of my Mac (under Parallels).
Question by:qeng
  • 4
  • 2
  • 2
  • +1
LVL 62

Expert Comment

by:☠ MASQ ☠
ID: 40610723

Unless you are using a keyboard that allows storage of keyboard sequences it its own flash memory (these are generally high end gaming keyboards) you will need to use separate applications for each operating system.  

Keyboard macros are normally stored in data files on the computer.

Author Comment

ID: 40610739

We used to have such a keyboard (Logitech G15 if I recall) years ago which I'd bought for my kids when they were into gaming.  In my case here, it's the built-in MacBook Pro keyboard.

It's easy enough for me to code the sequence on both sides.  Which apps would you recommend for the OS and Win sides (I worry about introducing a virus/logger with some of the free apps or about resource utilization with it running constantly in the bkgd)?
LVL 53

Assisted Solution

strung earned 200 total points
ID: 40610768
You could try TextExpander: There is a free downloadable demo so you can find out if it will do what you want before you buy it.
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

LVL 62

Accepted Solution

☠ MASQ ☠ earned 250 total points
ID: 40610770
Automator - built into OSX will do this kind of thing but it does seem a particularly bad idea to both trust your credentials to a third party program and to store them in plain text on a device in a macro.  In fact as I'm writing this I think Apple have set Automator not to write to anything that looks like a password field because of this (although it's possible to switch off that protection).

In Windows I use AutoHotKey which needs some very basic programming but will do what you need. Same reservations apply!

In both OS' by necessity you'll have to run a background service to be ready for when you want to enable the function so there are resource implications.

The Logitech board BTW actually stores the keystrokes in a Windows file, I was thinking more of something like the top-of-the-line Razer's and Roccats that have their own flash ROM so you can unplug the board and take it to another machine and it will still "remember" the keystroke sequences (and believe it or not some people actually do that!).
LVL 27

Assisted Solution

by:Thomas Zucker-Scharff
Thomas Zucker-Scharff earned 50 total points
ID: 40616886
I saw this question and my immediate response was AutoHotkey (there is a MAC version, albeit not as robust, IMHO).  So I second MASQ's suggestion for AHK.

Author Comment

ID: 40620744
Thanks all.

I'm familiar with AutoHotkey, having used it in the past.  For whatever reason (can't recall the specifics since I'd run into a few issues on and off), I became uncomfortable with using it (developed paranoia about background logging) and stopped using it.

For reasons MASQ suggests, I wanted to avoid trusting my credentials to a free 3rd party program (not that a paid one  is a guarantee of security), hence the reason I was hoping to develop my own simple script (with your help of course!).

The basic idea would be to have a script which targets the active browser page and enters the necessary login info (I realize I'd need to define the right html elements on the target page) and to execute that script with a keyboard shortcut which calls a background service to execute the said script.  Presumably the background service would consume minimal resources given that all it would do would be to call my script.

From the above, it seems as though I'd need to duplicate this approach on both the Mac as well as Windows sides of my MBP but that shouldn't be a big deal.

Is this do-able? Or is my paranoia around AHK misplaced, and I should simply trust that it's not acting as a logger of some sort and use it on both the Mac and Windows side to solve my problem (I realize MASQ touched on this)?

Strung:  I tried taking a look at TextExpander (I'll most likely dig into it further as it seems quite powerful) but I'm running into some silly issues trying to view some of their instructional videos.  When I browse to their website and try to play one of their videos (to learn more about their app features) my Mac > Chrome (64bit) browser throws 'You must install the Quicktime browser plug-in to view this content'.  This led me into a whole series of other issues worthy of a separate question which I'll post later (tons of posts on Chrome 64 and QuickTime plug in issues).  I ended up using Safari to view some of the TextExpander tutorials.  Looks very promising just as a productivity app.  It appears to be a Mac-only app (I may still want to get it).  Do you have experience with a similar product for Windows which could use the same snippets used by TextExpander.  I get a bunch of hits looking for 'Text Expander for Windows' ... hard to tell they hype from what actually works well.

LVL 53

Assisted Solution

strung earned 200 total points
ID: 40621019
Sorry, I have never used anything similar on the Windows side. I don't know if Textexpander will work when running Windows under Parallels. It might if it runs on a system wide basis and treats Parallels as just another application. You could download the free demo and try it.

Author Comment

ID: 40653499
Thx Strung, I'll work with that.

I haven't been able to get back to this so I'll close this question off now.

Author Closing Comment

ID: 40653509
The experts provided well targeted help.  I will need to do more research and experimentation before I can properly implement (e.g. I don't know how to setup a background service to run the keystroke macros on the Mac as well as on the Windows side)

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question