Query BackgroundFileOps setting

Discuss and share scripts and script files...
Post Reply
altoclef
Posts: 71
Joined: 12 Oct 2012 18:54

Query BackgroundFileOps setting

Post by altoclef »

Is there a scripting command to get the value of BackgroundFileOps?

I'm debugging a script that uses setting but, without using the p option, I haven't found a way of checking whether my script is making the desired change. Without the ability to query the setting while my script is running, I can't be sure what's happening.

highend
Posts: 14123
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Query BackgroundFileOps setting

Post by highend »

setting can't get it so probably not.
One of my scripts helped you out? Please donate via Paypal

jupe
Posts: 3198
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Query BackgroundFileOps setting

Post by jupe »

As long as you have included the setting cmd (without p) in your script then you can be sure of its state because the cmd works for the duration of the script, so knowing its state shouldn't be necessary, but if you really, really, think it is you can do it the long way, but it requires using "p" and saving a temp file with savesettings.

altoclef
Posts: 71
Joined: 12 Oct 2012 18:54

Re: Query BackgroundFileOps setting

Post by altoclef »

Thank you both for your responses.
jupe wrote: 07 Apr 2025 21:01 ... it requires using "p" and saving a temp file with savesettings.
Your suggestion helped me find the answer :) (I found I didn't need to use "p" before saving the temp file).

I have a script (script1) that calls a function in another (script2). I'd moved my setting statement from script1 into script2, where savesettings proved that my statement was still working. However, when script2 ended and code execution continued in script1, another call to savesettings showed that the setting had been reset to the default.

I then realised that when the help says:
all modified options are restored automatically by XY when script execution ends
it does not mean that this happens when all script execution ends, but when the script that changed the settings (script2) ends.

This makes sense. Thank you for helping me towards the answer.

Post Reply