在AppleScript中传递引号“do shell script”...再次

时间:2013-05-10 01:54:32

标签: applescript

我在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"

我想要做的是,再次传递字符串

do shell script "rm -f ~/Library/LaunchAgents/com.playlister.whateverthedatestampis.plist"

引号在正确的位置。我正在盲目地试图改变报价,我几乎得到了它,但并不完全。

非常感谢任何见解或帮助!

1 个答案:

答案 0 :(得分:2)

你想这样做吗?

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"