I found this question about the possibility to exchange windows paths with mac users and vice versa.
How to translate between Windows and Mac -style file locations?
It's working great for me, but for some reason the finder won't open paths with special characters in it. For example ä, ö, ü (which are common in germany).
I thought they are converted or something. So I removed the tell application part and replaced it with return mylocation
to see whats happening. The returned path is the correct one and also special characters are in it.
Why does the finder not open it? Is there any workaround for this?
I paste the code here, so we talk about the same thing without confusion:
on searchReplace(theText, SearchString, ReplaceString)
set OldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to SearchString
set newText to text items of theText
set AppleScript's text item delimiters to ReplaceString
set newText to newText as text
set AppleScript's text item delimiters to OldDelims
return newText
end searchReplace
on run {input, parameters}
set myClip to the input
set mylocation to searchReplace(myClip, "<", "")
set mylocation to searchReplace(mylocation, ">.", "")
set mylocation to searchReplace(mylocation, ">", "")
set mylocation to searchReplace(mylocation, "\\", "/")
set mylocation to "smb:" & mylocation
set mylocation to searchReplace(mylocation, " ", "%20")
tell application "Finder"
open location mylocation
end tell
# after setting the location, set Finder to topmost, or delete this section if you dont want that.
tell application "Finder"
activate
end tell
return input
end run
input
is typically a list, andopen location
is not from Finder.\\Servername\Folder 1\Folder 2\Folder with ä as special character
When I usereturn mylocation
as described above, the path would be translated intosmb://Servername/Folder%201/Folder%202/Folder%20with%20ä%20as%20special%20character
open location
opens files and URLs with umlauts just fine on my Big Sur machine. I was asking what is being used to get the input to the AppleScript action - if it is a Finder action, you might try using POSIX paths, sinceopen location
is not from the Finder.