It looks like thescriptMRUList
is a semicolon separated list but semicolons are valid in filenames on most filesystems.
The forbidden printable ASCII characters are:
Linux/Unix:
/ (forward slash)
Windows:
< (less than)
> (greater than)
: (colon - sometimes works, but is actually NTFS Alternate Data Streams)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)
Yes, although for systems with a command line that uses semicolons to separate commands, you have to quote them with back slashes. Similarly if we used, say, "|". Yes, you can quote that character to put them into a filename to access on the command line.It looks like thescriptMRUList
is a semicolon separated list but semicolons are valid in filenames on most filesystems.
Yes, although for systems with a command line that uses semicolons to separate commands, you have to quote them with back slashes. Similarly if we used, say, "|". Yes, you can quote that character to put them into a filename to access on the command line.
Curious: how would YOU propose formatting a property which is a list of file names?
Could you run an older version and show us a screenshot of this submenu feature that is now gone?I still think submenu folders are a big missing feature from this change. I think it's very useful to be able to organize bookmarked scripts into folders like how scripts menu used to behave. It's the biggest reason why I wanted to revert to the previous system.
I'm not going to do that. I use other tools to process preferences files and they expect a / as a special character or part of a directory name. At this point it is easier for me to tell *inux users not to use a ; in a script file name.Since directories are omitted from the list, why not forward slashes? They're the most common disallowed character for filenames across MacOS, Linux and Windows.
Maybe that might have been true historically, but I've successfully used semicolons in file names on Windows since at least Windows 7, including in Windows Explorer no less.I just checked because semi-colons once were not allowed on Windows. The best answer I found was that you cannot create a file with a semi colon in the file using exclusively Windows components but if you somehow create one on a *nix box and copy it to Windows, it will be treated as a valid filename for most commands.
It has worked that way for years, at least, longer than MCroft has been a mafia dev.MCroft - Did you implement something that would generate the above or was it all done by directories under scripts/ ?
Ok, this just sucks.This is why I solicited suggestions and bug reports. “The behavior changed” is not a good bug report. “The new feature is not working as intended” is a good bug report. “I miss such-and-such and here is an idea to get the essence of what I miss” is a good suggestion.
Well, add my name to the pile of complaints, I guess.You don't. You complain a lot and hope others agree with you and then something gets reverted or added back in.
Curious: how would YOU propose formatting a property which is a list of file names?
// formatting as string
JSONArray ja = new JSONArray(listOfStrings);
String str = ja.toString(); // AFAIK, this will produce a one-liner
// parsing a string
JSONArray ja = new JSONArray(str);
List<Object> list = ja.toList(); // or iterate for (int i=0; i< ja.length(); i++) { ja.getString(i); }
It has worked that way for years, at least, longer than MCroft has been a mafia dev.
Ok, this just sucks.
The context is a KoLmafia preference that has to be read and written by KoLmafia preference utilities and editable by a plain vanilla text editor. I'd still like to use gawk on preference files. So JSON may be the best solution but at this point I'd rather tell people they can't use a semi-colon in a script file name.As far as I can see, kolmafia is already using a json library ... why not encode to a (stringified) json array? That should automagically take care of escaping any special characters, in a standard way.
If I am googling correctly (best intro I found is https://www.baeldung.com/java-org-json):
Code:// formatting as string JSONArray ja = new JSONArray(listOfStrings); String str = ja.toString(); // AFAIK, this will produce a one-liner // parsing a string JSONArray ja = new JSONArray(str); List<Object> list = ja.toList(); // or iterate for (int i=0; i< ja.length(); i++) { ja.getString(i); }