macro quit script ?

i excute many script on screen
i would like to destory many script and macro at once

how can i close script window at once ?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

If the scripts are not encrypted then you can see the global "name" of the rollouts. What you have to do then is to use for loop to destroy dialogs with the desired names.

For example:

global rol_01
rollout rol_01 "The name of the rollout"
(
 
)
createdialog rol_01
global rol_02
rollout rol_02 "The name of the rollout 01"
(
 
)
createdialog rol_02
global rol_03
rollout rol_03 "The name of the rollout 03"
(
 
)
createdialog rol_03

To close the "The name of the rollout rollout you have to use

destroyDialog rol_01
destroyDialog rol_02
destroyDialog rol_03
robobear510's picture

OK.. now how do you destroy the dialog on exit

OK.. now how do you destroy the dialogs upon exiting the script .. the on quit do (whatever) doesn't seem to work when you just close the rollout.. I have a main script and a few ones pop out, I can destroy them in the beginning of the script but not when I just close the rollout window.. any solutions on that?

miauu's picture

.

If I understand you correctly yo need this:

(
	global rol_MyRollout
	try(destroyDialog rol_MyRollout)catch()
	rollout rol_MyRollout "My Rollout"
	(
		-- when the main rollout is closed
		on rol_MyRollout close do
		(
			--	destroy other dialog shere
		)
	)
	createdialog rol_MyRollout 
)
robobear510's picture

hmm.. yes

hmm.. yes exactly..
..actually did that but placed it after the createdialog :) - forgot this should probably be the part of the rollout, thanks
.. is the global rollout necessary I do it without that, or why?

miauu's picture

.

If your code ls this:

(
	try(destroyDialog rol_MyRollout)catch()
	rollout rol_MyRollout "My Rollout"
	(
		-- when the main rollout is closed
		on rol_MyRollout close do
		(
			--	destroy other dialog shere
		)
	)
	createdialog rol_MyRollout 
)

Then all variables are in local scope, so you can't access them.

If your code is:

	try(destroyDialog rol_MyRollout)catch()
	rollout rol_MyRollout "My Rollout"
	(
		-- when the main rollout is closed
		on rol_MyRollout close do
		(
			--	destroy other dialog shere
		)
	)
	createdialog rol_MyRollout 

Then the rollout var(rol_MyRollout) is a global var and you can access it and all controls and local variables of the rollout.

Since I always use the first aproach(all of my code is between "(" and ")") i have to declare the tollout as global.

robobear510's picture

and just realised you should

and just realised you should also use

try (destroyDialog dialog ) catch()

because if that rollout isn't open it gives out error.. or it doesn't close the main rollout, just for future reference

barigazy's picture

...

better is to declare rollout var as global

try(destroyDialog ::dialog )catch()
--or
global dialog
try(destroyDialog dialog )catch()

barigazy

robobear510's picture

yes - and I need the global

yes - and I need the global rollout variable defined like you just did - or it wont close the rollout - also just realized this :).. what's with the ::dialog (didn't get to that part yet)

OK learning as I go.. I did programming in java years ago, and it's like learning how to walk again, this place is a great resource

barigazy's picture

...

If you want to avoid try-catch then you can use also

if isKindOf dialog RolloutClass do destroyDialog dialog
--or :)
if isKindOf ::dialog RolloutClass do destroyDialog dialog

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.