ScriptSpot home

Forum topic · General Scripting

escaping a batch process.

By zahid hasan · 2012-03-16

Description

hi guys
i am trying to make a batch script.but i cant escape by pressing "ESC" .when i press esc then it goes on to next step.the script is like this,

rollout A opens up a rollout B
pressing "OK" on rollout B
process a series of max file by 4 script (c1.ms,c2.ms,c3.ms,c4.ms)

i am thinking about a (escape checker then exit) in the array loop of rollout B.is it the proper way? how can i code it effectively.

i am still on primary stage of max script. please try to help me out.thanks.

Comments (4)
miauu

Maybe like this:( for i = 1

Maybe like this:

(
	for i = 1 to YouKnow.count do
	(
		if keyboard.escPressed do exit
		
		--	do all stuff here
		
	)
)

If you have nested for loops in the main for loop you can put
if keyboard.escPressed do exit
in their begining too, to speed up the script termination.

Reply to miauu
zahid hasan

:-) thanks for prompt reply. i gonna check it.

Reply to miauu
zahid hasan

its working perfectly.i was a bit pissed and put the exit code in three different places.;-)so now its escaping within a fraction of seconds.
thanks again.