Jump to content

The ESC Key - glitch with scripts


Katerina

Recommended Posts

The esc key will cancel a command,

-but-

it will cancel at the point of where the script has read, and not the script entirely.

-therefore, if preferences are being set in a script in the first lines, the new change of preference remains, because the procedure was before the point of hitting the ESC key.

I discovered this when I had an offset duplicate question., earlier today

I wish the esc key will cancel the entire script, from the first procedure. (posted wish list item, I was told to also post here)

Link to comment

{I am able to stop a script with esc or by running another script.

but :

A script will run and read each line.

If esc or other command is selected while the script is running,

the lines that were already read sticks.

You'll see what I mean by trying this test.

Cancel out of this command before drawing a rect.

p.s.

this isn't a command I would use, just a test}

Procedure test;

VAR

p:boolean;

BEGIN

DSelectAll;

p:=GetPref(9);

If (p=false) then begin

SetPref(9,true);

end;

If (p=true) then begin

SetPref(9,false);

end;

{cancel command before it reads the following text,

you will see the preference set above sticks}

SetTool(-203);

end;

RUN (test);

Link to comment

In my experience you are right. The actions done by a script up to the point of escape will stick, but those actions can be undone with command+z or by choosing undo from edit menu.

I tried your test and it did change "zoom line". But if I undo the script the pref isn't changed. Or more precisely it is changed and then changed back.

I guess this is more along the lines of a work-around.

Some of my scripts can take a long time to execute on a large file and sometimes I run one prematurely. I cancel the script and then use "undo" to return the file to the state it was in before I ran the script.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...