Welcome to MacBoardz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Extracting text from text control in an application from a..

 
   Macintosh computer (Home) -> Apple Scripts RSS
Next:  Script to open all files in a directory  
Author Message
"umop

External


Since: Jun 16, 2008
Posts: 1



(Msg. 1) Posted: Mon Jun 16, 2008 4:14 pm
Post subject: Extracting text from text control in an application from applescript
Archived from groups: alt>comp>lang>applescript (more info?)

Hi. I'd like to know if it's possible to extract text from a cocoa
text control (or whatever they're called) in an application. Like
(and I know that this wouldn't work, but you get the general idea):
get value of text control starting with "Line:" in front window of
application TextMate

Thanks in advance!
umop

 >> Stay informed about: Extracting text from text control in an application from a.. 
Back to top
Login to vote
Jolly Roger

External


Since: Sep 09, 2006
Posts: 1943



(Msg. 2) Posted: Mon Jun 16, 2008 6:58 pm
Post subject: Re: Extracting text from text control in an application from applescript [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
"umop (Eric)" wrote:

> Hi. I'd like to know if it's possible to extract text from a cocoa
> text control (or whatever they're called) in an application. Like
> (and I know that this wouldn't work, but you get the general idea):
> get value of text control starting with "Line:" in front window of
> application TextMate

What are you actually trying to accomplish by reading that value?
What's the "big picture" task you want to accomplish?

--
Please send all responses to the relevant news group rather than directly
to me, as E-mail sent to this address may be devoured by my very hungry
SPAM filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google Groups.
You'll need to use a real news reader if you want me to see your posts.

JR

 >> Stay informed about: Extracting text from text control in an application from a.. 
Back to top
Login to vote
Jolly Roger

External


Since: Sep 09, 2006
Posts: 1943



(Msg. 3) Posted: Tue Jun 17, 2008 11:22 pm
Post subject: Re: Extracting text from text control in an application from applescript [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
"umop (Eric)" wrote:

> On Jun 17, 1:27 pm, Jean-Marie Schwartz
> wrote:
> > Vous lisez mes messages et vous faites bien. Le 17/06/08 1:14, umop (Eric) a
> > écrit :
> >
> > > Hi.  I'd like to know if it's possible to extract text from a cocoa
> > > text control (or whatever they're called) in an application.  Like
> > > (and I know that this wouldn't work, but you get the general idea):
> > > get value of text control starting with "Line:" in front window of
> > > application TextMate
> >
> > Sorry but I don't get what you mean by "text control". And I don't know
> > TextMate app.
> > Is the window an alert window, a dialog window or a document window?
> > Is the text "static" or in a field or in a document?

> Okay. Forget the TextMate example. Just imagine Safari or something
> and a control which isn't given a dictionary reference. A textfield
> or a label which has a value which I'd like to extract. The hugely
> complicated way of doing this would be to snap a picture of the
> application and look at the actual graphical value of the text-field.
> I'm sure that the gui values are available somehow.

Again, what is it you are actually trying to accomplish?

--
Please send all responses to the relevant news group rather than directly
to me, as E-mail sent to this address may be devoured by my very hungry
SPAM filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google Groups.
You'll need to use a real news reader if you want me to see your posts.

JR
 >> Stay informed about: Extracting text from text control in an application from a.. 
Back to top
Login to vote
Jean-Marie Schwartz

External


Since: Jun 07, 2007
Posts: 14



(Msg. 4) Posted: Fri Jun 20, 2008 9:40 am
Post subject: Re: Extracting text from text control in an application from [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Vous lisez mes messages et vous faites bien. Le 18/06/08 4:20, umop (Eric) a
écrit :

> Okay. Forget the TextMate example. Just imagine Safari or something
> and a control which isn't given a dictionary reference. A textfield
> or a label which has a value which I'd like to extract. The hugely
> complicated way of doing this would be to snap a picture of the
> application and look at the actual graphical value of the text-field.
> I'm sure that the gui values are available somehow.

What you could try to do is to tell System Events to get that value. BUT
it's not always doable.
Just to help you in that, run the code "tell application "System Events" to
get entire contents of window 1 of the application process "Safari" and
search into the results for the text you wish. If it's not in there, I'm
afraid you won't be able to get it that simply.
Let us know.

--
Jean-Marie

« Priez pour nous, pauvres pécheurs, maintenant et à tout à l'heure »
(«Je vous salue Marie», Gainsbourg)
 >> Stay informed about: Extracting text from text control in an application from a.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
a b but a as text = b as text - I sort-of understand this but I don't know how to cure it. In a very complicated AppleScript Studio application I compare two text strings. Sometimes they're equal. Sometimes they're not. But instead of comparing the contents of the text strings, what...

clean Text - Just upgraded to osx. Used to use Claris eMailer and it had a slick script called clean forward. What it did was remove all the garbage from email before forwarding. Is there similar one for Mail in OSX? tia, if you could point me in the right direction...

Quotes in text - Hello I am working on a script that will write some text files for me from text box input. I need to know how I can have applescript ignore a " symbol in a text string. Any suggestions would be helpful. Thank you Lowell

Is it possible to get all text before a period? - Hi there, I have a script that says: Set x to text -5 through -8 of item y This selects 4 character filenames of picture or music files without the extension. Sometimes pictures have a 4 letter extension (like 2014.jpeg) then my script fails. Can I tell...

print text - how can I write an apple script which prints a text message I tried print "Saint Louis, Missouri" but I know I'm missing some code this sounds so simple, but I cant figure it out
   Macintosh computer (Home) -> Apple Scripts All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]