Page 1 of 1
Open a Property Inspector by script
Posted: Fri Oct 22, 2010 1:24 pm
by Dixie
Hi...
Is it possible to open the property inspector of an object by script... and have it display the geometry settings on opening ?
be well
Dixie
Re: Open a Property Inspector by script
Posted: Fri Oct 22, 2010 6:18 pm
by WaltBrown
Dixie,
I was only able to get to the main Properties screen for button "TestButton" using:
Code: Select all
on mouseUp
choose pointer tool
send "mouseDoubleUp" to btn "TestButton"
end mouseUp
which I am sure you got to as well. Beyond that I looked into the rev stacks to see if there was anything obvious (my own curiosity), but there wasn't an obvious way to tell it to open a Geometry card of the revPropertyPalette stack. There probably is a way, but it's going to take some digging. Plus, it reacted oddly to my digging even with "Suppress Messages" selected, so there are probably land mines as well.
Walt
Re: Open a Property Inspector by script
Posted: Fri Oct 22, 2010 6:20 pm
by FourthWorld
Even simpler:
edit script of this cd
In the script use:
on resizeStack x,y
-- put your resize stuff here:
end resizeStack

Re: Open a Property Inspector by script
Posted: Fri Oct 22, 2010 6:46 pm
by Dixie
Walt, Richard...
Thanks for your replies... Shao Sean gave me a script that works really well...
Code: Select all
on mouseUp
# get the target of this control
local tTargetID
put the long id of the target into tTargetID
# create the inspector linked to this control
send "revBuildPropertyPalette tTargetID" to stack "revTemplatePalette"
# get the name of the inspector linked to this control
local tPaletteName
put revPropertyPalettes(tTargetID) into tPaletteName
# bring the inspector stack into use so we can use the scripts from it (we could do this with the value() function)
start using stack tPaletteName
# get the text for the drop down menu (the first line is the object type)
local tTabs
put revObjectTabs2(tTargetID) into tTabs
# lock the screen so we do not see the selection handles
lock screen
select tTargetID
# get the proper geometry card to display
local tDefaultCard
put revGeometryCard() into tDefaultCard
# deselect the control and unlock the screen
select EMPTY
unlock screen
# go to the correct inspector pane
revBuildPropertyPaletteGoCard tDefaultCard, tPaletteName, tTargetID, tTabs
# get the inspector to remember the pane it is displaying
revRememberPane
# no longer need the palette's scripts
stop using stack tPaletteName
end mouseUp
I don't know enough about all this stuff that begins with 'rev'
be well
Dixie
Re: Open a Property Inspector by script
Posted: Sat Oct 23, 2010 4:47 am
by WaltBrown
I was impressed with Shao's script, in the depth of investigation done in the LC tool stacks.
Walt