Combine file/folder path selection to windows link

Good first shot! Only missing the backslash between SD and SD Studio.

\SDSD Studio\2021\

The only thing is that it doesn’t work with the other server shares that we have. Let me describe the situation.

Server SD 192.168.100.25 (add SD before links)

  • SD Studio
  • Share A
  • Share B
  • Share C

Server NT 192.168.100.20 (add NT before all links)

  • NT Studio
  • Share F
  • Share R
  • Share Y

‘Share’ is not the real name of the shares. Do you need the exact names of the server shares?

Yes, please provide the exact share names. And thank you for pointing out the missing backslash. That’s easily put back in, which will be done after getting the other share names.

Ok see below the share names.

Server SD (add SD before links)

  • SD Studio
  • SD Archive
  • Cloche Studio B

Server NT (add NT before all links)

  • NT Studio
  • 0920 Studio
  • 0920 Archive
  • Cloche Studio A

Let’s try this:


set windowsPaths to ""
set TID to AppleScript's text item delimiters
try
	set windowsPathsList to {}
	tell application "Finder"
		repeat with currRef in (get selection)
			set {volumeName, HFSPath, volumeID} to {currRef's disk's name, currRef as text, missing value}
			if {volumeName} is in {"SD Studio", "SD Archive", "Cloche Studio B"} then
				set volumeID to "SD"
			else if {volumeName} is in {"NT Studio", "0920 Studio", "0920 Archive", "Cloche Studio A"} then
				set volumeID to "NT"
			end if
			if volumeID ≠ missing value then
				set AppleScript's text item delimiters to ":"
				tell (get HFSPath's text items)
					set AppleScript's text item delimiters to "\\"
					set end of windowsPathsList to "\\\\" & volumeID & "\\" & it
				end tell
			end if
		end repeat
	end tell
	set AppleScript's text item delimiters to linefeed
	set windowsPaths to windowsPathsList as text
end try
set AppleScript's text item delimiters to TID
return windowsPaths

Works like a charm! :smiley:

Testing it over VPN. I’m gonna test this when i’m at the office monday, but i don’t foresee any problems.

Thank you a lot bmose!

You’re most welcome.

Best wishes.