1
Tech / Fill forms
« on: July 05, 2010, 09:03:58 AM »QUOTE
tell application "System Events" to tell process "TextEdit" to keystroke "v" using {command down} Another method would be to try the 'key code' command in the script: tell application "System Events" to tell process "TextEdit" to key code 125 --down to new line "Tab" is 9 in the ASCII list, BTW.
IT WORKS!!!!!!!!!!
Often when I'm trying to understand how a script should work I need to step away for a time and let it gel in my head. It struck me this morning, and I was surprised at how easy it was!!!
No need to jump to a plain text editor. I made a VERY simple Applescript that looks like this:
QUOTE
tell application "Safari"
activate
end tell
tell application "System Events"
key code 9 using command down (this invokes "paste")
keystroke tab
end tell
activate
end tell
tell application "System Events"
key code 9 using command down (this invokes "paste")
keystroke tab
end tell
This script will paste the copied info into the currently selected field in the browser. Then it tabs to the next field.
Then....
A FMP Script sets up a loop to copy the contents of the appropriate field (the grade).
Then the Applescript activates Safari and pasts the grade into the first student's grade field.
FMP then copies the next field (the comments), and the SAME Applescript pastes it, and then tabs to the next field, which is the NEXT student's grade.
The FMP Script then goes to the next record and loops the process, exiting after last.
Thanks for the think tank!!!!