我正在使用automator来实现这一点。这是我正在使用的applescript代码(在此处的其他地方找到):
get the clipboard
set the clipboard to (replacement of "/Volumes/" by "afp://servername.com/" for the result)
on replacement of oldDelim by newDelim for sourceString
set oldTIDs to text item delimiters of AppleScript
set text item delimiters of AppleScript to oldDelim
set strtoks to text items of sourceString
set text item delimiters of AppleScript to newDelim
set joinedString to strtoks as string
set text item delimiters of AppleScript to oldTIDs
joinedString
end replacement
get the clipboard
set the clipboard to (replacement of "/Volumes/" by "afp://servername.com/" for the result)
除非我选择多个文件,否则这非常有效。任何人都可以帮忙吗?当输入是多个文件路径时,此代码似乎失败。