• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Class/Properties syntax baffles me
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Class/Properties syntax baffles me


  • Subject: Re: Class/Properties syntax baffles me
  • From: Paul Berkowitz <email@hidden>
  • Date: Sun, 05 May 2002 10:45:15 -0700

For many applications, if you want a property of an application element
(class), you have to first evaluate the element either as Simon just did -
by a variable - or by using the explicit 'get'. I don't have Interarchy
5.0.1 here to try it, but I expect this will also work:

tell application "Interarchy 5.0.1"
name of (get frontwindowrecord)
end tell

--
Paul Berkowitz

> From: Simon Topliss <email@hidden>
> Date: Sun, 05 May 2002 18:26:25 +0100
> To: Applescript Mailing List <email@hidden>
> Subject: Re: Class/Properties syntax baffles me
>
> Works for me (10.1.4).
>
> tell application "Interarchy 5.0.1"
> set fwr to frontwindowrecord
> name of fwr
> end tell
>
> Simon
>
> On 5/5/02 5:53 pm, "Doug McNutt" <email@hidden> wrote:
>
>> I just don't have any more time for searching of the help files. Would
>> someone
>> please short circuit the learning curve for me? What is the "proper" syntax
>> for the simple act of extracting a property from an instance of a class?
>>
>> From the Interarchy scripting dictionary:
>>
>> Class window: a window
>> Properties:
>> bounds bounding rectangle [r/o] -- the bounds of the window
>> name string [r/o] -- the name of the window
>> position point [r/o] -- the position of the top left corner
>> **
>>
>> frontwindowrecord: returns the record for the front window
>> frontwindowrecord
>> Result: window -- the front window's information
>> **
>>
>> -- Interarchy is up and running; this works.
>> tell application "Luna:Applications:Communication:Interarchy 5.0.1:Interarchy
>> 5.0.1"
>> frontwindowrecord
>> end tell
>>
>> Returning this to the result window:
>> {name:"FTP Disk Manager", bounds:{48, 451, 544, 603}, position:{48, 451}}
>> **
>>
>> What I want is just the name of the window.
>> Within the tell block I have tried these. Error messages from running the
>> script are after -->
>>
>> name of frontwindowrecord --> expected expression but found command name.
>> "name" of frontwindowrecord --> same
>> get name of frontwindowrecord --> same
>> get "name" of frontwindowrecord --> same
>> get the name of frontwindowrecord --> same
>> get the item named "name" of frontwindowrecord --> same
>> get the first item of frontwindowrecord --> same
>> get the text of the item named "name" of frontwindowrecord --> same
>> name in frontwindowrecord --> same
>> item 1 of frontwindowrecord --> same (Note that "name" doesn't appear in the
>> line.)
>> frontwindowrecord:name --> Expected "given", "in", "of" . . . . but found ":"
>> frontwindowrecord.name --> Unknown token
>> frontwindowrecord->name --> Naah. That's not even C++
>>
>> Does the text "command name" in the error message mean that the script
>> processor found some command with a name that it won't identify or does it
>> mean that the word "name" is being taken as a command? A reserved word?
_______________________________________________
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.

  • Follow-Ups:
    • Re: Class/Properties syntax baffles me
      • From: Simon Topliss <email@hidden>
References: 
 >Re: Class/Properties syntax baffles me (From: Simon Topliss <email@hidden>)

  • Prev by Date: Re: Class/Properties syntax baffles me
  • Next by Date: Re: Class/Properties syntax baffles me
  • Previous by thread: Re: Class/Properties syntax baffles me
  • Next by thread: Re: Class/Properties syntax baffles me
  • Index(es):
    • Date
    • Thread