That does not seem to be working and I am using the plain script from github linked above.
Any thoughts?
(To be clear I opened your project and started moving around, but nothing happened.)
That’s an attribute indicator. In this case the attribute (click the gear icon) is “Hidden” from the autocomplete list, because strictly speaking, that particular constant is not for use in the execution of your project. It’s for use by the script only.
I have since recopied an unaltered version into the Xojo Scripts folder and restarted several times.
Yes, the “ConstantStorageLocation” line looks like that.
Yes, I am moving around inside the Window1.Opening event.
I am not seeing and reformatting or errors, like MISSING_PARENTHESES, showing up.
I have a maybe stupid question, please forgive me if I missed something: Are you aware that you have to trigger this type of script manually for it to work?
I think I only have one script installed and I have to trigger it on Windows with Ctrl+ALT+1 for it to work.
@Sascha_S of the many posts of yours that I have read I have never seen you ask a stupid question.
I have used this script previously and because of setting the option in the Coding section anytime you move past a line of code it should trigger the ReformatCode script.
By “move past” I mean moving your cursor line by line through the code, like what you might have in a “Pressed” or “Opening” event.
I don’t recall having to use any particular key stroke(s) to invoke it.
I could be wrong and often times am.
ReformatCode.xojo_script is special. When read, it does not appear in the scripts menu. The script is run automatically at specific times, the documentation outlines when that is: Custom code reformatting — Xojo documentation
The behavior will depend on which version of the IDE you are using (reference). You can test the script is running for sure by selecting the block of code, right clicking, and choosing “Standardize Format”.
I don’t know what to say Craig, on macOS, up to version 2025r1.1 this project and the original script is working by simply moving the up/down arrow keys through the lines of code.
Note: Not too long ago, it was discovered that the custom reformatting routines had briefly stopped working, but that was fixed. Maybe this is a new issue that affects Windows IDE’s?
As another suggestion, try enabling the debugging feature of the script to ensure the script is running. This is done by adding a DebugLevel constant to the ReformatSettings module (see left-side of my screen-shot), and give it a value of 2.
This was the changed behavior I was referring to. After my recent “that belongs in Testers” slip, I’m trying to be a little more well behaved. I’ve linked to the ticket / release note about this behavior changing.
Personally, I’m glad it’s being changed because I have clients that insist on committing the formatting changes. I just spent nine hours crafting my own ReformatCode.xojo_script because it was driving my OCD wild.
No worries Scott. I really appreciate your time and everyone else’s.
It would be nice to get this working, but at the end of the day, for me, it is a “nice to have” and not critical functionality.
I will keep puttering around with this and if I get it working I will post more here.