传递引号“do shell script"在 AppleScript 中......再次 [英] Passing quotes "do shell script" in AppleScript... Again
本文介绍了传递引号“do shell script"在 AppleScript 中......再次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 AppleScript 中有以下行
I have the following line in AppleScript
set msgDate to (current date) as string
set removalString to "\"rm -f ~/Library/LaunchAgents/com.playlister.\"" as string
do shell script "echo do shell script " & removalString & msgDate & ".plist" & ">> ~/Library/Playlister/" & msgDate & ".applescript"
我再次尝试做的是传递字符串
What I'm trying to do, yet again, is pass the string
do shell script "rm -f ~/Library/LaunchAgents/com.playlister.whateverthedatestampis.plist"
with 在正确的位置加上引号.我在盲目地尝试使报价正确时移动了很多东西,我几乎已经明白了,但还没有完全明白.
with the quotes in the correct place. I'm moving stuff around quite a bit in a blind attempt to get the quotes right, and I've almost gotten it, but not quite.
感谢任何见解或帮助!
推荐答案
你想这样做吗?
set msgDate to (current date) as text
set removalString to "rm -f ~/Library/LaunchAgents/com.playlister."
do shell script "echo do shell script \\\"" & removalString & msgDate & ".plist\\\"" & " >> ~/Library/Playlister/" & quoted form of msgDate & ".applescript"
这篇关于传递引号“do shell script"在 AppleScript 中......再次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文