Spiderguy 发表于 2022-7-6 23:45:53

Close script file doesn't

Hello to all!
 
I have a recorded action that is a staple of mine for a long time, I used it long ago even though it was created differently, I even have a bunch of coworkers that use it. The recorded action is ZOOM EXTENTS, SAVE, RUN SCRIPT FILE; CLOSE.SCR. I think I created this back in 2010, and it has worked in every instance of AutoCAD until 2014. I originally had to record the action using the CLOSE.SCR file with the command "SAVE" in it so that it could be recorded. Once the Action was recorded, I changed the "SAVE" command to "CLOSE". So that when I type the "ZSC" name of the recorded action, it would zoom the file to extents, save it, then close the drawing. Now when I try to execute this action, it does everything except close the file. I have run the CLOSE.SCR file using the script command and still I get nothing!
 
Any help would be appreciated!
 
Thanks,
 
Matt

Tuns 发表于 2022-7-6 23:50:56

So, it saves then it doesn't close? What does it say in the command line?

Spiderguy 发表于 2022-7-6 23:57:55

I get this message when I try to run it through SCRIPT command.
 
File load canceled: I:\AutoCAD Recorded Macros\CLOSE.SCR
 
I have tried to re-record the action because originally the action was for another version, then I recorded it again for 2013 to change the folder location. before I was getting this message:
 
Enter script file name : I:\AutoCAD 2013\CLOSE.SCR
"CLOSE.SCR": Can't find file.

JGA 发表于 2022-7-7 00:04:01

Would it not be easier just to include all the commands in the recorded action?

Tuns 发表于 2022-7-7 00:07:55

Maybe a support path is messed up?

BIGAL 发表于 2022-7-7 00:11:48

Post the script easier to work out whats wrong you should have done that first post only need a few lines.

Spiderguy 发表于 2022-7-7 00:15:12

Sorry, the script file is simple a txt file named "CLOSE.SCR" in it is simply the word "close(hard return)". For what ever reason, I cannot upload the file, the upload manager just simply "spins" and does nothing.
 
I checked all of the file locations and have that fixed. this is what I get when I try running the recorded action:
 
Command: ZSC
ZOOM
Specify corner of window, enter a scale factor (nX or nXP), or
: E
Command: QSAVE
Command: SCRIPT
Enter script file name : I:\AutoCAD 2013\CLOSE.SCR File load canceled: I:\AutoCAD 2013\CLOSE.SCR
Command: Playback of action macro complete
 
It looks like the script command has changed some, when I simply type in script, I am presented with a selection window to find and select the file. So trying to record a new action that involves a script is probably not the way to go. however, when I type SCRIPT in the command line, find and select the CLOSE.SCR file this is what I get:
 
Command: SCRIPT
File load canceled: I:\AutoCAD 2013\CLOSE.SCR
 
I copied "CLOSE.SCR" to my desktop, entered SCRIPT into the command line and selected the "CLOSE.SCR" from the desktop and it successfully worked.
 
The problem is why is it canceling the load operation from the I:\AutoCAD 2013 location?

Spiderguy 发表于 2022-7-7 00:18:52

Hello!
 
Thank you all for your interest in helping me!
 
I have it figured out, it had to do with the security of "trusted" locations!
 
Unfortunately, I have not figured out how to edit the recorded action file so that I can redirect the file location to simply "I:\AutoCAD Recorded Actions" so that from here on out I wouldn't have to make sure everything went to a 2013 folder, but that is not the worst thing to happen!
 
Thanks again!

Tuns 发表于 2022-7-7 00:23:58

Glad to hear you got it working.

YZ 发表于 2022-7-7 00:29:31

Can you edit macros that have been created with the action recorder?
 
If the only thing in the script is a close command, you might then be able to write it in to you macro.I may have misunderstood your objective, but it would remove a layer of complication.
 
Add this to end of your macro:

Close;
页: [1] 2
查看完整版本: Close script file doesn't