Re: more details (was Re: how to get the text selection in an applescript)
Re: more details (was Re: how to get the text selection in an applescript)
- Subject: Re: more details (was Re: how to get the text selection in an applescript)
- From: Gary Lists <email@hidden>
- Date: Tue, 20 Jan 2004 03:36:22 -0500
leo wrote [01-19-04 9:40 PM]:
>
i guess url composing, safari and iKey are straight forward. what's missing
>
is a preferably general way how to find the selected text and how to replace
>
the selection with another text.
>
>
hope that makes it a little bit clearer,
Except you still didn't mention the most central element of your question:
What is the application that you use to do word processing.
As others and I have mentioned, "selecting" in AppleScript is usually
implemented at the application level. It makes sense to do that, as
'objects' or 'things' which can be selected -- while a general action -- are
different from application to application.
Being specific somehow didn't quite happen.
Michael Terry gave you some kinds of starter code to try out in your word
processor. He should you that there are different kinds of 'select' or
'seletion' statements.
I also mentioned several sources to which you should turn. I'll do that
again.
For your word processor (what the heck is it, a secret?), look at its
dictionary. Even better, look for sample scripts. BBEdit, Tex-Edit, Style,
MS Word, Alpha?
For your browser (Safari) you can see sample scripts for how to send
commands to go and get URL's and even to save the resulting text.
You mention the clipboard on Windows, as if there somehow wasn't one on the
Mac. What? Yes, you can put many kinds of things on the clipboard. You
would use the clipboard (if you wanted to) to pass around a text URL or some
text returned from a web page. That's no problem...but not really needed if
you use a variable.
That still doesn't address the getting of the text you have selected (you
can use UI scripting to Copy/Paste if you want...but why?) and the replacing
with your translations. The word processor seems to be the key here...where
most of your work will take place.
Look at samples, look at the dictionary (drag the application to Script
Editor and open it to see the commands and AS reference for that
application.)
Or tell someone what you are using at least.
--
Gary
P.S. Don't change the subject line of an active thread unless the subject
really is changing. IMO, that is.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.