0

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

在正确的位置加上引号。我在盲目地尝试使引号正确的情况下移动了很多东西,而且我几乎得到了它,但并不完全正确。

任何见解或帮助表示赞赏!

4

1 回答 1

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"
于 2013-05-10T03:06:07.047 回答