Re: UI Scripting Plist Editor
Re: UI Scripting Plist Editor
- Subject: Re: UI Scripting Plist Editor
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 11 Nov 2003 15:53:05 -0500
You didn't indicate whether you are running under Jaguar or Panther. The
following applies to Panther:
To expand and collapse topics in the outline view in Property List Editor,
you can't use an action because rows don't have actions. Instead, set the
'disclosing' attribute of a row. 'Disclosing', if true, means that the
outline topic is disclosing its subtopics, or expanded; if false, that it is
collapsed.
In UI Browser, you can do this by selecting the desired row element in the
main browser view, then selecting the 'disclosing' attribute in the
Attributes drawer, then checking or unchecking the Set checkbox in the
Attributes drawer. Property List Editor's outline view will respond
immediately.
In Panther's version of GUI Scripting, attributes like this are generally
set using the new 'attribute "AX-----"' syntax. Inside the usual double tell
block for GUI Scripting, this command will expand the root topic heading in
Property List Editor:
set value of attribute "AXDisclosing" of row 1 of outline 1
of scroll area 1 of splitter group 1 of window 1 to true
UI Browser's AppleScript menu will provide the reference to the row for you,
but it won't currently provide the 'set value of attribute "AXDisclosing"
of' part of this command -- you have to know how to do that yourself. The
'disclosing' attribute is not recognized by GUI Scripting, so UI Browser
won't generate a more direct AppleScript command to set it.
For most traditional attributes, such as the 'value' attribute of a text
field, UI Browser will generate a direct GUI Scripting command, because the
value attribute is recognized by GUI Scripting.
The children of a typical row in Property List Editor are the row's name
text field, Class pop-up button and Value field. The Class pop-up button has
a 'press' action, which should open the pop-up menu, but I haven't tried
actually setting it to a new value as opposed to just reading its current
value. The name text field purports to have a settable string value, but I
haven't tried setting it, either. The Value field is presumably what you
want to control, but it can have different types based on the value of the
Class pop-up, so this may be somewhat complex. I haven't tried to set this,
either.
Have fun, and share your discoveries with the list.
on 2003-11-11 2:35 PM, Brandon Lake at email@hidden wrote:
>
Has anyone tried this? And had a bit of success? I would really like
>
to edit some of the properties of a plist, but the farthest I got was
>
opening the plist:
>
>
-- my Folder is the path to the folder just created, and plist is the
>
name of a file inside of it
>
-- this part works
>
tell application "Property List Editor"
>
activate
>
set plistToOpen to myFolder as string
>
set plistToOpen to plistToOpen & plist as string
>
open plistToOpen as alias
>
end tell
>
>
Once the plist was open I could not do anything. A tree structure is
>
already present in the opened plist, I tried to expand the tree using
>
the new PreFab UIBrowser's click position, and varied anything I
>
thought might help. But it wouldn't expand. If there is a better way
>
to do this (manually is not better :-) I would be grateful for
>
information. Or if anyone has had any luck opening an outline on the
>
property list editor, any examples or info would be great.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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.