tags:

views:

38

answers:

2

Really basic, but how to write a character with Applescript. My 'd' key is broken, i'd like to assign a script to a f1-12 key just to write that character in any application. Thank's!

A: 

It would be easier if you simply acquired a new keyboard.

Not all applications are scriptable, GUI scripting is unreliable, and sometimes even the simplest of scripts can take multiple seconds to run, so Applescript really isn't a reasonable solution to your broken keyboard problem.

Philip Regan
Thank you! Any other way to simulate "d" key with a f1-12 key?
pample
There probably is a way, but I think it would just be easier to buy a new keyboard.
Philip Regan
As it's the keyboard of my MacBook Pro which has "d" key defect, buying a new keyboard would mean buy a new laptop.The keyboard had some liquid and therefor it's not a keyboard problem anymore, but a motherboard problem... thank's anyway Philip ;)
pample
You don't have to replace the whole laptop to replace the keyboard, you only have to replace the keyboard, and since that requires removing the motherboard, you might as well replace that as well.
Philip Regan
A: 

This should do: tell application "System Events" keystroke "d" end tell

magikseb
Thank you so much magikseb!!! It's exactly what i needed!
pample
If this is the answer you need, then please give magikseb credit by accepting his answer.
Philip Regan
What Philip said... accept my answer?
magikseb