【发布时间】:2019-10-10 02:16:34
【问题描述】:
我有一个别人写的脚本。它可以在他的计算机上运行,但不能在我的计算机上运行。
原来是"as alias",但我一直收到如下错误消息:
"Can’t make file "Macintosh HD:Users:williamsato:Desktop:Photobooth:CurrentSession" into type alias."
所以我根据另一篇帖子中的建议将alias 更改为string。
现在我没有收到该错误消息,但我确实收到了一条新消息,如下所示:
"Can’t get every file of "Macintosh HD:Users:williamsato:Desktop:PhotoBooth:CurrentSession"."
它突出显示 “将 SourceFolder 的文件移动到 DestinationFolder 并替换”
不知道出了什么问题。
谢谢
on run {input, parameters}
set SourceFolder to POSIX file "/Users:/williamsato/Desktop/Photobooth/CurrentSession" as string
set DestinationFolder to POSIX file "/Users/williamsato/Desktop/Photobooth/PreviousSessions" as string
tell application "Finder"
move files of SourceFolder to DestinationFolder with replacing
end tell
(* Clear Large Type *)
tell application "System Events" to keystroke "a" using command down
end run
【问题讨论】:
-
1.这个脚本是如何运行的? 2. 按照编码,它需要是
as alias3. 有一个:不应该在/Users:/中。 4. 你对tell application "System Events" to keystroke "a" using command down有什么期望?根据您显示的代码,我认为它没有任何价值!
标签: applescript