Hello All
Problem:
When applescript sends characters to “TextEdit” or “Word 2004” it send them as fast as possible. I am looking for the option\setting that will allow me to set the input speed of the characters.
I want to set the character input speed to simulate typing at 60 words per minute.
Is this possible?
I searched on this subject and could not find an answer, If you know of a post that will answer this please point me to it.
Thanks
Chad
Model: Macbook
AppleScript: 2.0
Browser: Safari 3.0.4
Operating System: Mac OS X (10.4)
This should do it… it types one character at a time with a delay in between. You might have to mess with the delay a bit if you want 60 wpm, but that’s just a matter of trial and error.
set texttowrite to "This text will be typed slower than normal."
tell application "TextEdit" to activate
tell application "System Events"
repeat with i from 1 to count characters of texttowrite
keystroke (character i of texttowrite)
delay 0.04
end repeat
end tell
Just remember that this command counts as keyboard input, so if you do something like hold down command while it’s typing, you’ll get all the keyboard shortcuts.
Thanks for the info.
I am a newbie and after trying multiple configurations I was not successful in getting both scripts to work together.
Question:
How can I set the keystroke speed for a large section of text, so that each line of text is typed at human speed?
The previous post does show how to enter text at human speed, but I have more than one line of text.
Thanks
Chad
Here are the first few lines of the script that I am working on.
tell application "Microsoft Excel"
launch
set the startup dialog to false
activate
close every workbook saving no -- This gets rid of the open work book
delay 5 -- delay added so that I can watch actions, will be removed later
beep 3 --Audio Cue, will be removed later
set newBook to make new workbook
end tell
tell application "Microsoft Excel"
activate object worksheet "Sheet1"
delay 5
-- Start of Section 1
set value of range "B2" to "Terms, Cost,Residual Value, and Tax rate"
set value of range "B3" to "Lease Term (36 Months)"
set value of range "B4" to "Money Factor"
set value of range "B5" to "Representative Interest Rate"
set value of range "B6" to "Price residual vaule based on (MSPR)"
set value of range "B7" to "Agreed upon price of the vehicle"
set value of range "B8" to "Residual Value"
set value of range "B9" to "State Lease Tax Rate ( TX=6.25%)"
--The following lines will make cell B2 BOLD
activate object cell "B2" of worksheet "Sheet1"
set bold of font object of active cell to true
-- End of section 1
end tell
I don’t have the latest version of Excel (I have Excel X), but the slow typing technique works for me with this:
tell application "Microsoft Excel"
Activate
Select Cell "B2"
my slowType("Terms, Cost,Residual Value, and Tax rate")
Select Cell "B3"
my slowType("Lease Term (36 Months)")
Select Cell "B4"
my slowType("Money Factor")
Select Cell "B5"
my slowType("Representative Interest Rate")
Select Cell "B6"
my slowType("Price residual vaule based on (MSPR)")
Select Cell "B7"
my slowType("Agreed upon price of the vehicle")
Select Cell "B8"
my slowType("Residual Value")
Select Cell "B9"
my slowType("State Lease Tax Rate ( TX=6.25%)")
end tell
to slowType(someText)
tell application "System Events" to tell process "Excel"
repeat with i from 1 to count characters of someText
keystroke (character i of someText)
delay 0.04
end repeat
end tell
end slowType
- Thanks
That will work for me as well
Thanks again
Chad
Model: Macbook
AppleScript: 2.0
Browser: Safari 3.0.4
Operating System: Mac OS X (10.4)