CreateDialog and then execute a function or press button?

CreateDialog and then execute a function or press button?

dg3duy
Collaborator Collaborator
1,608 Views
3 Replies
Message 1 of 4

CreateDialog and then execute a function or press button?

dg3duy
Collaborator
Collaborator

Is it possible to start a function after using Create Dialog?
Another possibility that can help me is that after Create Dialog a button is automatically pressed. Thank you

0 Likes
Accepted solutions (1)
1,609 Views
3 Replies
Replies (3)
Message 3 of 4

miauuuu
Collaborator
Collaborator
Accepted solution

As Swordslayer told you:

 

(
	global rol_test
	try(destroyDialog rol_test)catch()
	rollout rol_test "Test"
	(
		button btn_pressMe "Press Me"
		
		function ShowTheTime =
		(
			startTime = getLocalTime()	
			format "Time is % \n" (startTime[5] as string + ":" + startTime[6] as string + ":" +startTime[7] as string )
		)
		
		on btn_pressMe pressed do
		(
			print "Button pressed"
		)
		
		on rol_test open do
		(
			ShowTheTime()
			btn_pressMe.pressed()
		)
	)
	createdialog rol_test 
)
https://miauu-maxscript.com/
Message 4 of 4

dg3duy
Collaborator
Collaborator

both Swordslayer and miauuuu hit the target, solve the obstacle!

thank you very much to both

0 Likes