I have a cript that places some text on the clipboard. I need to paste this into a syntax window. SPSS is not scriptable I know but I thought that this sort of work around might help.
set theApp to “SPSS 11 for MAC OS X”
tell application theApp to activate
try
tell application “System Events”
tell process theApp
set frontmost to true
keystroke “V” using command down
end tell
end tell
on error
display dialog “It didn’t work!”
end try
Well I either get the error dialog, or I get a “v” in the text syntax field.
IS there another way of pasting the clipboard into this app?
Using a capital v is the same as saying shift+command+v, which doesn’t do anything.
Try: keystroke “v” using command down
You may have to put in a one or two second delay.
Also, you might have better luck using the free UI Element Inspector or PreFab Software’s better UI Browser. It will allow you to target the input area. I don’t have SPSS so I can’t say exactly how it would work.