Re: Selected text from Terminal?
Re: Selected text from Terminal?
- Subject: Re: Selected text from Terminal?
- From: Dave Stewart <email@hidden>
- Date: Mon, 1 Dec 2003 11:14:33 -0800
On Dec 1, 2003, at 6:16 AM, Dennis Cox offered this:
>
Just get the contents of the window, text is not involved.
>
>
get contents of window 1
>
>
Dennis
Hi Dennis!
That's what I thought, but when I try this:
set tempContents to (get contents of window 1)
I get this:
System Events got an error:
NSCannotCreateScriptCommandError
(the word "contents" is highlighted in Smile).
Nothing tricky being attempted yet, this is just trying to grab the
text in the open Terminal window (I'll try something tricky if I can
get this to work).
I did notice that in the "Attributes" drawer in Bill's PreFab UI
Browser that "selected text" displays no type or value. Does that mean
something important Bill (like "you can't get there from here")?
Other thoughts, ideas and suggestions warmly welcomed.
>
>
> ----------
>
> From: Dave Stewart
>
> Sent: Friday, November 28, 2003 2:33 PM
>
> To: AppleScript List
>
> Subject: Selected text from Terminal?
>
>
>
> Hey again guru's!
>
>
>
> Maybe it's just that I'm still recovering from Turkey Overdose (and a
>
> mild hangover:), but for some reason it seems like this should work
>
> but
>
> I can't get it to behave. Even threatening it with extreme violence
>
> hasn't helped. ;-)
>
>
>
> I'm trying to grab some text from a Terminal window. The dictionary
>
> for
>
> Terminal claims that I can use the window "contents", so that inspired
>
> me to try things like this:
>
>
>
> get contents of text 1 of window 1
>
>
>
> But every attempt at that gives this result:
>
>
>
> System Events got an error:
>
> NSCannotCreateScriptCommandError
>
>
>
> OK, maybe GUI scripting is my answer! Bill's PreFab UI Browser tells
>
> me
>
> to try this:
>
>
>
> get value of static text 1 of window 1
>
>
>
> But every attempt at that produces this:
>
>
>
> System Events got an error:
>
> NSReceiverEvaluationScriptError: 4
>
>
>
> Hmmm, that doesn't help much. I just want to have my script check the
>
> text on the Terminal screen to make it more robust (a "did what I just
>
> try result in what I expected?" kind of thing), so this isn't CRITICAL
>
> but it looks like it should work.
>
>
>
> Is it possible or "not implemented yet"? Anyone have a script that
>
> yanks text from a Terminal window successfully?
>
>
>
> Particulars:
>
> 450MHz G3 "Blue & White", 256MB RAM, 60GB drive
>
> OSX 10.3.1 "Panther"
>
> PreFab UI Browser 1.2 (v44)
>
> Smile 2.5.2 / ASS 1.9.2 (? came w/ Panther) & Xcode 1.0.1
>
> (Using Smile to test sections of code, Xcode to integrate parts and
>
> test package)
>
>
>
>
>
>
>
> Dave Stewart
>
> Aqua-flo Supply (Goleta)
>
> dstewart at aquaflo dot com
>
>
>
> Be nice to other people; they outnumber you 5.6 billion to 1
>
> _______________________________________________
>
> 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.
>
>
>
>
>
>
Dave Stewart
Aqua-flo Supply (Goleta)
dstewart at aquaflo dot com
Be nice to other people; they outnumber you 5.6 billion to 1
_______________________________________________
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.