Prevent Scripting Halt/Break on Error?
Forum rules
You might want to read this if you're looking for priority service
Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).
Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.
How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
You might want to read this if you're looking for priority service
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
-
Zardoz2293
- Posts: 638
- Joined: 09 Nov 2011 20:20
- Location: USA
Prevent Scripting Halt/Break on Error?
I wrote a complex folder/file rename script years ago and it worked perfectly. Now my error trapping doesn't work as XY throws the Scripting Error dialog/window on the screen rather than what it once did which was provide an empty string which I knew was an error and processed it as an error.
I've searched and I haven't seen a posting which indicates how to disable the scripting dialog from appearing.
I've searched and I haven't seen a posting which indicates how to disable the scripting dialog from appearing.
XYplorer v28.50.0101
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
-
PeterH
- Posts: 2830
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Prevent Scripting Halt/Break on Error?
Maybe an example of the error situation could help a bit to understand this?
(I assume it's the return of some function in some situation?)
(I assume it's the return of some function in some situation?)
-
Zardoz2293
- Posts: 638
- Joined: 09 Nov 2011 20:20
- Location: USA
Re: Prevent Scripting Halt/Break on Error?
The script command below throws the error "The process cannot access the file because it is being used by another process." dialog. I trap all errors in the code so a dialog telling me there's an error is not wanted at "run time" when I'm using the script, when debugging, yes, otherwise no.
The cause is one of the files in the folder is currently in use and originally $Folder would return an empty string on an error and process accordingly.
The cause is one of the files in the folder is currently in use and originally $Folder would return an empty string on an error and process accordingly.
Code: Select all
$Folder = renameitem( "{Deprecated} " . "*", $Folder );XYplorer v28.50.0101
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
-
PeterH
- Posts: 2830
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Prevent Scripting Halt/Break on Error?
OK: help talks about "name collision", but not about "access collision"
- so Don must say something.
But as I thought: this probably will be about renameitem(), not generally about scripting.
By the way, for lazy people like me: why not simply "{Deprecated} *"
But as I thought: this probably will be about renameitem(), not generally about scripting.
By the way, for lazy people like me: why not simply "{Deprecated} *"
-
Zardoz2293
- Posts: 638
- Joined: 09 Nov 2011 20:20
- Location: USA
Re: Prevent Scripting Halt/Break on Error?
Thanks for the information thus far PeterH! Greatly appreciated.
Not sure why this isn't a "scripting" issue and not looking to split hairs either.
So we are saying what? Can't turn off the error/debug window at normal execution for all errors, now (since what release)? Tested the entire script for all conditions of errors on 2012-02-23. It's in the past month or two where I've had this condition occur with ever frequency. It would be nice to know what can be done to resolve so the script can execute smoothly without halting.
Saying something like, what?PeterH wrote:OK: help talks about "name collision", but not about "access collision"- so Don must say something.
But as I thought: this probably will be about renameitem(), not generally about scripting.
Not sure why this isn't a "scripting" issue and not looking to split hairs either.
Because that's not the actual code, but represents the scripting command line to address the problem.PeterH wrote:By the way, for lazy people like me: why not simply "{Deprecated} *"
So we are saying what? Can't turn off the error/debug window at normal execution for all errors, now (since what release)? Tested the entire script for all conditions of errors on 2012-02-23. It's in the past month or two where I've had this condition occur with ever frequency. It would be nice to know what can be done to resolve so the script can execute smoothly without halting.
XYplorer v28.50.0101
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
-
PeterH
- Posts: 2830
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Prevent Scripting Halt/Break on Error?
I think I can explain: the reaction on a "problem" seen by the function is programmed into that function. (OK: there can be exceptions.) So if Don will change something here he probably has to change this function, nothing about the scripting engine itself. And to know this he must exactly know about the error that occured - so I pre-asked.Zardoz2293 wrote:Not sure why this isn't a "scripting" issue and not looking to split hairs either
Compare: the handling of this subroutine for "name collision". It also is just an internal of the routine, and so is described with it, not with scripting in general.
It may be not of interest for you - but at least it is for Don. Without knowing this he is unable to help.
-
Zardoz2293
- Posts: 638
- Joined: 09 Nov 2011 20:20
- Location: USA
Re: Prevent Scripting Halt/Break on Error?
PeterH, so what exactly do you believe is "missing" from my second posting to this thread which would prevent solving the problem so I can expand on the details?PeterH wrote:I think I can explain: the reaction on a "problem" seen by the function is programmed into that function. (OK: there can be exceptions.) So if Don will change something here he probably has to change this function, nothing about the scripting engine itself. And to know this he must exactly know about the error that occured - so I pre-asked.Zardoz2293 wrote:Not sure why this isn't a "scripting" issue and not looking to split hairs either
Compare: the handling of this subroutine for "name collision". It also is just an internal of the routine, and so is described with it, not with scripting in general.
It may be not of interest for you - but at least it is for Don. Without knowing this he is unable to help.
XYplorer v28.50.0101
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
Re: Prevent Scripting Halt/Break on Error?
Peter didn't ask for anything more in his latest post here, he was just explaining something
(that something being "why this is not a problem with the whole scripting engine" (and he said that in the first place because of the way you titled the topic (a more fitting title would be "SC renameitem() fails on locked files")))
btw, moved toq&a bugreports.
(that something being "why this is not a problem with the whole scripting engine" (and he said that in the first place because of the way you titled the topic (a more fitting title would be "SC renameitem() fails on locked files")))
btw, moved to
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
Zardoz2293
- Posts: 638
- Joined: 09 Nov 2011 20:20
- Location: USA
Re: Prevent Scripting Halt/Break on Error?
Actually my posting was correct under the scripting forum. If I was told there was/is a way to prevent scripting from throwing the error dialog I could prevent the renameitem() and any other potential future related (either bugs or by design). Where do I imply it's a problem with the whole scripting engine?
The reality is the correct answer to my question is apparently "You cannot, as an end-user, configure/prevent the scripting error dialog from popping in all cases" and apparently the answer is No.
The reality is the correct answer to my question is apparently "You cannot, as an end-user, configure/prevent the scripting error dialog from popping in all cases" and apparently the answer is No.
XYplorer v28.50.0101
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
-
PeterH
- Posts: 2830
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Prevent Scripting Halt/Break on Error?
That's right.SammaySarkar wrote:Peter didn't ask for anything more in his latest post here, he was just explaining something
(that something being "why this is not a problem with the whole scripting engine" (and he said that in the first place because of the way you titled the topic (a more fitting title would be "SC renameitem() fails on locked files")))
btw, moved toq&abugreports.
But it *also* is about giving info when reporting about some problem.
The next doesn't apply especially to this situation - it's general, with this situation just as an example!
I think we've learned that the problem here lies in a function. And to think about it we must know this! Because, as long as we don't talk about this function, we don't talk about this problem!
So, in general: report scripting errors always with (excerpt from) the script showing the problem.
My first post was to get this info for the current topic, my further posts were more in general, as I often see problems reported, without really specifying the situation where the problem occured.
The last, on topic again: this *might* be a bug. But maybe it's just a wish. As this situation doesn't seem to be documented, we can't know this. At the end Don might say: "can't / will not change!" - so we must wait for him to give info.
-
Zardoz2293
- Posts: 638
- Joined: 09 Nov 2011 20:20
- Location: USA
Re: Prevent Scripting Halt/Break on Error?
SC renameitem throws "The process cannot access the file because it is being used by another process." error message during execution. What is the workaround to either prevent the XY scripting dialog from being displayed (when this event occurs)?
XYplorer v28.50.0101
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Prevent Scripting Halt/Break on Error?
You cannot suppress error messages in scripting.
FAQ | XY News RSS | XY X
-
PeterH
- Posts: 2830
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Prevent Scripting Halt/Break on Error?
Hm - this was the reason why I posted it as a wish in the thread "Scripting Command to Prevent Scripting Error Dialog Disp", on 29.3.2015, 12:45.admin wrote:You cannot suppress error messages in scripting.
Though I'm aware that it sounds like 'some work' for you.
(And no: I don't see it as a bug. Just something where the scripter should have more control.)
XYplorer Beta Club