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.
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 ).
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.
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.
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.
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.
I’m late to this party, but I would really like to be able to set a preference to show the alert as Ray requested.
If I am building a new project and developing called scripts, I want to save with Debugging 90% of the time. But once the project goes live, and I need to debug during production mode, I need the alert as I wind up saving with debugging on at least half the time. Of course this stops the live process in it’s tracks, and then I have to stop what I’m doing to simply open the file and resave with debugging off.