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.
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.
Yes, when drag-and-dropping a file into SD and the prompt appears with the options for HFS path, POSIX path, alias, etc.
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
Please try out the 8.0.1 beta:
Thank you for adding in these options to v8.0.1!