删除“引用形式”上的引号在苹果脚本中?
我有以下代码来复制 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
唯一的问题是它会导致这样的结果:
'/Applications/Burn.app/' '/Applications/Caffeine.app/' '/Applications/Calculator.app/'
这基本上就是我想要的,但我不希望那里有那些该死的单引号。我该如何摆脱它们?我已经尝试删除引用形式
但没有运气。
谢谢!
I have the following code to copy paths of multiple 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你所要做的就是取出“引用形式”
all you have to do is take out "quoted form of "