Notifications
Clear all

[Closed] assign shortcut in script

I need assign shortcut to some buttons in rollout in script.
How does it make the easiest?

I know only one solution and that creates buttons function like idividual scripts and then it somehow connects through.
But unfortunetly i don’t know how can i connect more script. e.g. that I can from one script make a reference to (e.g. spinner) in rollout in different script.
Could you HELP me pls?
It should help me the most some tiny example.
(sorry for my english)

5 Replies

I’m really desperate

So i show some sample:
If i have 2 scripts and in first script i have e.g. spinner (spn1). If i change spn1.value i want to change some global variable (e.g. X). And then in second script i want use the variable X.

I tried a lot of syntax global variable and i don’t know what i do.

🙁
so i show next specific sample.

Here’s first script:


  rollout test "test" width:162 height:300
  (
  	spinner spn1 "" pos:[22,19] width:118 height:16
  	on spn1 changed val do
  	(
  	global g = 5
  	spn1 value:g
  	global g = spn1.value
  	)
  )
  createdialog test

Here’s second script

Box length:g width:g height:g

I want to if i change in first script value on spinner to change the global variable “g” and when i run the second script so i want to e.g. create BOX with length, width, height = g (global variable). But it doesn’t work

Could somebody HELP me pls pls pls?

The problem was edited

First functional script:

rollout test "test" width:162 height:300 
  ( 
     spinner spn1 "" pos:[22,19] width:118 height:16 range:[0,100,0] scale:1 
     on spn1 changed val do 
     ( 
  	global g=spn1.value 
     ) 
  ) 
  createdialog test

say you have this rollout for example:


rollout my_first_rollout "My First Rollout"
(
spinner spinner_one "Height: "
)
createdialog my_first_rollout

to be able to access the spinner from anywhere in max (assuming you’ve run the script), you can type this:


my_first_rollout.spinner_one.value

so you can create a simple box by typing:


box height:my_first_rollout.spinner_one.value

hope this helps:)

galagast: SUPER… so it’s best.

THX a lot