Open the inspector by script

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Fermin
Posts: 142
Joined: Fri Jun 05, 2015 10:44 pm

Open the inspector by script

Post by Fermin » Sun Apr 11, 2021 7:14 pm

Hello, please... Is there a direct way to open by script the inspector of a control (field, graphic etc...) to edit its properties?
I'm trying with 'doMenu' but it doesn't seem to work. Is there any other way?

Code: Select all

on mouseUp
   if the optionkey is down then 
      select the target
      doMenu "Object Inspector" of menu "Object"
      exit to top
   end if
   -- etc...
end mouseUp
Thank you very much

I have read something on this forum but I guess there must be something simpler:
viewtopic.php?t=5943
Last edited by Fermin on Sun Apr 11, 2021 8:32 pm, edited 2 times in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Open the inspector by script

Post by richmond62 » Sun Apr 11, 2021 7:37 pm

Something wrong here:
-
SShot 2021-04-11 at 21.36.22.png
-
Oddly enough, while the doMenu command works, something subsequently screws up:
-
SShot 2021-04-11 at 21.39.40.png

Fermin
Posts: 142
Joined: Fri Jun 05, 2015 10:44 pm

Re: Open the inspector by script

Post by Fermin » Sun Apr 11, 2021 10:25 pm

Ok. I think I found a way:

Code: Select all

select menuItem 1 of menu "object" 
instead of:

Code: Select all

doMenu "Object Inspector" of menu "Object"

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Open the inspector by script

Post by richmond62 » Mon Apr 12, 2021 6:59 am

Ok. I think I found a way:
Then the Documentation needs to be sorted out.

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Open the inspector by script

Post by Klaus » Mon Apr 12, 2021 6:47 pm

Hi friends,

I Have these scripts in my little personal tools palette to open the inspector for the current card resp. the current stack:

Code: Select all

...
## Card
revIDEOpenInspectorForObjects the long id of this cd of the topstack
...
## Stack 
revIDEOpenInspectorForObjects the long id of the topstack
...
Hope that helps!

HINT:
This will only work with LC >= 8!


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Open the inspector by script

Post by dunbarx » Tue Apr 13, 2021 9:50 pm

I think this has always worked:

Code: Select all

on mouseUp
   select menuItem 3 of menu "object"
end mouseUp
Craig

Post Reply

Return to “Talking LiveCode”