开发者

Remove quotes on "quoted form of" in Applescript?

开发者 https://www.devze.com 2023-03-13 03:31 出处:网络
I have the following code to copy paths of mu开发者_开发技巧ltiple selected items in Finder: activate application \"Finder\"

I have the following code to copy paths of mu开发者_开发技巧ltiple selected items in Finder:

activate application "Finder"
tell application "Finder"
    set theSel to (selection of application "Finder")
    set pathList to {}
    repeat with anItem in theSel
        set the end of pathList to quoted form of (POSIX path of (anItem as alias))
    end repeat
    set savedDelimiters to AppleScript's text item delimiters
    set AppleScript's text item delimiters to "
"
    set the clipboard to pathList as string
    set AppleScript's text item delimiters to savedDelimiters
end tell

The only problem is that it results in this:

'/Applications/Burn.app/'
'/Applications/Caffeine.app/'
'/Applications/Calculator.app/'

Thats' basically what I want, but I don't want those damn singlue quotes in there. How do I get rid of them? I already tried just removing quoted form of but without luck.

Thanks!


all you have to do is take out "quoted form of "

    activate application "Finder"
tell application "Finder"
    set theSel to (selection of application "Finder")
    set pathList to {}
    repeat with anItem in theSel
        set the end of pathList to (POSIX path of (anItem as alias))
    end repeat
    set savedDelimiters to AppleScript's text item delimiters
    set AppleScript's text item delimiters to "
"
    set the clipboard to pathList as string
    set AppleScript's text item delimiters to savedDelimiters
end tell
0

精彩评论

暂无评论...
验证码 换一张
取 消