Paste HFS/POSIX paths with ending colon or forward slash?

Is there a preference or other way to have Script Debugger always paste the HFS/POSIX paths for directories to include a subsequent colon or forward slash? We do a lot of path building and almost always require those in our paths. Pasting as alias includes them but we’re usually not working with aliases so that preceding “alias” would be just as much of a pain to remove. Just a small improvement that would be nice.

2021-05-12_12-02-40

SD will paste whatever is in the clipboard. Here are three options:

You could put a script in the scripts menu that converts the path(s) in the clipboard to posix paths (and pastes).

You could drag and drop files from the finder into an SD window, and chose the option of pasting as a posix path.

You could put a script in the SD scripts menu that changes the selection into a posix path.

I suspect what Sean is referring to is when you drag a file into the script window.

1 Like

Yes, when drag-and-dropping a file into SD and the prompt appears with the options for HFS path, POSIX path, alias, etc.

1 Like

So when you do that, the resulting quoted path is selected. You can then run this script:

tell application id "com.latenightsw.ScriptDebugger8" -- Script Debugger.app
	tell document 1
		set selRange to selection as point
		set theSel to selection as text
		if theSel contains ":" and character -2 of theSel is not ":" then
			set theSel to (text 1 thru -2 of theSel & ":\"")
			set selection to theSel
			set item 2 of selRange to (item 2 of selRange) + 1
			set selection to selRange
		else if theSel contains "/" and character -2 of theSel is not "/" then
			set theSel to (text 1 thru -2 of theSel & "/\"")
			set selection to theSel
			set item 2 of selRange to (item 2 of selRange) + 1
			set selection to selRange
		end if
	end tell
end tell
1 Like

Please try out the 8.0.1 beta:

2 Likes

Thank you for adding in these options to v8.0.1!

1 Like