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: 154
Joined: Fri Jun 05, 2015 10:44 pm

Open the inspector by script

Post by Fermin »

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: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: Open the inspector by script

Post by richmond62 »

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: 154
Joined: Fri Jun 05, 2015 10:44 pm

Re: Open the inspector by script

Post by Fermin »

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: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: Open the inspector by script

Post by richmond62 »

Ok. I think I found a way:
Then the Documentation needs to be sorted out.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Open the inspector by script

Post by Klaus »

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: 10502
Joined: Wed May 06, 2009 2:28 pm

Re: Open the inspector by script

Post by dunbarx »

I think this has always worked:

Code: Select all

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