Type a text from a palette stack to an external window

Lynn Marie Peterson lmpeterson at mac.com
Wed Mar 1 08:46:43 EST 2006


Paul Consolo asked:
<<
There is a way to let Revolution (also via Applescript) may type a text on
an external app window (i.e. a text editor)?

I've tried using various AS tips to bring the ext. window to the frontmost,
but every time the focus remains on the stack (a systemWindow style
palette), and typing give back only an error sound.
>>
````````````````
Hi Paul ~

I am relatively new to RunRev, but I just ran into this recently in my own
project. I had the same problem with AS, but this is what I did (note this
does not include AS routine to transfer text, just activate an external app
window:

on mouseUp
  put "tell application" && quote & "Microsoft Word" & quote & return into
tAppleScript
  put "open" & return after tAppleScript
  put "end tell" after tAppleScript
  do tAppleScript as AppleScript
  put "tell application" && quote & "Microsoft Word" & quote & return into
tAppleScript
  put "activate" & return after tAppleScript
  put "end tell" after tAppleScript
  do tAppleScript as AppleScript
end mouseUp

I tried putting the AScript into one "put tell application", but I found the
same thing you did... it would launch the Word app, but not bring it to the
frontmost app, so I had to tell it to open and then activate in separate
"tell application" statements. I'm sure there is a more concise, elegant way
which the experts here on the list will provide.

Lynn P.
--
View this message in context: http://www.nabble.com/Type-a-text-from-a-palette-stack-to-an-external-window-t1205435.html#a3183270
Sent from the Revolution - User forum at Nabble.com.




More information about the Use-livecode mailing list