Page 1 of 1

Query BackgroundFileOps setting

Posted: 07 Apr 2025 17:24
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.

Re: Query BackgroundFileOps setting

Posted: 07 Apr 2025 17:45
by highend
setting can't get it so probably not.

Re: Query BackgroundFileOps setting

Posted: 07 Apr 2025 21:01
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.

Re: Query BackgroundFileOps setting

Posted: 07 Apr 2025 22:49
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.