Disable saving in Debugging mode


(Ray Robertson) #1

I think it is time to either make this a preference, with the ability to save in Debugging mode turned off by default, or at least make it more difficult to accidentally saving in Debugging mode (multiple warning dialogs).

This feature has always been cool, but I haven’t used it in a long time. I mostly debug droplets by dropping files directly in the script window with debugging on. Now with Mojave changes, other uses of it—such as folder actions debugging—are no longer practical.

This request is not just because more users in the forum are saving in debugging mode accidentally—it has happened to me as well. At minimum, I’d like a warning alert whenever I close script which is presently saved with debugging on. Hmm…maybe this is already an extended preference I have missed? Regardless, thanks for listening.


(Shane Stanley) #2

Anyone else have thoughts on this?

The issue is already flagged for consideration, but apart from the cases where people are doing it accidentally, I think you’re only the second person to call for the change to be made to SD itself.(Disclaimer: I was the first :wink:).

(And no, there no expert preference.)


(Mark Alldritt) #3

This has been an issue since v1. People have never understood the consequences of saving when debugging is enabled. SD operates as it does for practical rather than design reasons.

The challenge is enabling/disabling debugging involves a recompile.

If we adopt an approach where we don’t save debuggable documents, SD would have to re-compile on every save to remove debugging. This (a) can slow things down, (b) could introduce user interactions (e.g. property abc : choose folder) and (c ) resets the value of top-level variables.

Moving forward, (c ) may not be a blocking issue but (a) and (b) are.

On the upside, if saving without debugging were a choice, debugging its self could become an always-on thing.


(Ed Stockly) #4

The first time scripting in a particular editing session with debugging on, a notification might be good.

Closing and saving a script with debugging on could also trigger a warning.

But I’d hate to see a warning or notification pop up overtime I save with debugging on, and I wouldn’t want to compile for every save.


(Ray Robertson) #5

Mark,

Further clarification: I don’t mind saving with debugging on. I just want a warning when I close a document with debugging on. Is that feasible?

Ray


(Doeke Zanstra) #6

Indirectly related, I hope it helps:

I’m working on a git-filter, so you can work on an scpt file and the text-version is committed to git instead of the binary file. This filter has a safety feature to decline commit when you saved the debug-version.


(Mark Alldritt) #7

This is certainly feasible, but we’ll have to do this carefully. At least in my workflows, almost all of my documents have debugging enabled and adding a warning-on-save could become deeply irritating. Shane and I will see if we can find a workable middle ground on this.


(Stan Cleveland) #8

I’d be perfectly happy for Debugger to save two copies of every file. All I’d want to specify is the file type (text, script, bundle, app, or enhanced app). Enabling or disabling debugging wouldn’t even need to be an option—files would always be saved both ways, side by side in the target folder. The “bug” icon would show me which is which, so I’d simply open whichever one I want.

I suppose this would require two compilations per save, so may not be good for everyone. If nothing else, this method of dual-saving might be a nice option.

Stan C.


(Doeke Zanstra) #9

When I think about it, warn-on-close would be adequate. With a don’t-show-again-checkbox and a preference in SD preferences would please everyone?