I feel like the answer is just within reach, but my poor brain can’t figure out the POSIX path vs. alias vs. POSIX file, etc.
I want to use AppleScript to tell Script Debugger to save a file that contains a slash in the file name.
Here is my code
tell application "Script Debugger"
make new document with properties ¬
compile document 1
save document 1 as text script in script_path
close document 1 ¬
here, script_path might be something like Users:user1:Documents:bookmarks:filename_with_/_a_slash.applescript.
Note, this works if filename_with_/_a_slash.applescript does not have a slash, for example filename_without_a_slash.applescript.
Slashes are odd.
Open a document in Preview.app, click in the file name at the top of the window to open the little dialog and add a slash to its name. Works without hitch. At first, I thought that a similar UNICODE glyph is used, but no, its the standard slash. Now try a colon ( : ) - it even gets replaced by a slash. Try to do this in the Finder and it will act up on you. (Just realized that the Finder indeed accepts slashes, too. Never even dared to use one.)
Now drag the little icon besides the new name at the window’s top to an open terminal window and see how the slash gets converted to a backslash-escaped colon - somehow similar to the InDesign example.
And now type open + a space-character into a terminal window, drag again and hit return: “The file with the slashcolonthing does not exist”. Now double click the file’s icon in the Finder and hooray, it does exist.
Not that this helps. But go figure.