generic copying text?

in os 9 it was possible to select text of window by writing something like this:

 tell application "any app" 
   set x to selection of front window 
   return x
end tell

this would return the selected text. this basic function doesn’t seem to exist in x, or has changed to something i just don’t see.
i am trying to write a a script that will grab the selected text of the front window of the front app and then pass it off to a spell checker - all by selecting text and choosing the script from the script menu. anyhow, what i thought would be a simple thing did no turn out so. little help?
thanks.

: in os 9 it was possible to select text of window by writing
: something like this: tell application “any app” set
: x to selection of front window return x end tell

: this would return the selected text. this basic function doesn’t
: seem to exist in x, or has changed to something i just don’t
: see.

: i am trying to write a a script that will grab the selected text
: of the front window of the front app and then pass it off to a
: spell checker - all by selecting text and choosing the script
: from the script menu. anyhow, what i thought would be a simple
: thing did no turn out so. little help?

It never worked that way. AppleScript is application-specific and most commands are compiled from an application’s dictionary. The exceptions are the commands in the “required set”, which include “open”, “quit”, “print”, and a few others.

You need to perform one more manual step after selecting the text. Copy it to the clipboard. Then you can use the clipboards commands to get it to your spell checker.
Marc K. Myers
Marc@AppleScriptsToGo.com
AppleScriptsToGo
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074

[02/18/2002 11:55:52 PM]

: It never worked that way. AppleScript is application-specific
: and most commands are compiled from an application’s
: dictionary. The exceptions are the commands in the
: “required set”, which include “open”,
: “quit”, “print”, and a few others.
: You need to perform one more manual step after selecting the
: text. Copy it to the clipboard. Then you can use the
: clipboards commands to get it to your spell checker.
: Marc K. Myers < Marc@AppleScriptsToGo.com >
: AppleScriptsToGo
: 4020 W.220th St.
: Fairview Park, OH 44126
: (440) 331-1074
: [02/18/2002 11:55:52 PM]

So, just how do you get the name of the frontmost window? I’d like to paste it as text onto a spreadsheet. Thanks.

Dave

: So, just how do you get the name of the frontmost window? I’d
: like to paste it as text onto a spreadsheet. Thanks.
: Dave

You don’t need the name of the frontmost window if you’ve copied the text to the clipboard. Am I missing something?
Marc K. Myers
Marc@AppleScriptsToGo.com
AppleScriptsToGo
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074

[02/19/2002 1:29:41 PM]