Mac*_*nik 3 applescript finder
我已经创建了目录结构并将a文件放在A目录中:
~/A
~/B
Run Code Online (Sandbox Code Playgroud)
在AppleScript的,我试图移动文件a从A到B.这是我的代码:
on run
tell application "Finder"
move POSIX file "~/A/a" to POSIX file "~/B"
end tell
end run
Run Code Online (Sandbox Code Playgroud)
但是当我运行脚本时,我得到错误:
error "Finder got an error: Handler can’t handle objects of this class." number -10000
Run Code Online (Sandbox Code Playgroud)
这是我的问题的简化版本.有人能帮帮我吗?
尝试:
set myFile to POSIX file (POSIX path of (path to home folder) & "A/a.txt")
set myFolder to POSIX file (POSIX path of (path to home folder) & "B")
tell application "Finder" to move myFile to myFolder
-- OR
set myFile to (path to home folder as text) & "A:a.txt"
set myFolder to (path to home folder as text) & "B"
tell application "Finder" to move myFile to myFolder
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2284 次 |
| 最近记录: |