需要将mov文件移动到文件夹 - Applescripts

时间:2014-05-28 02:48:25

标签: applescript

我尝试使用带有空格的文件夹使用applescripts轻松地移动文件。

问题是我想将一个文件移动到另一个文件夹中。

文件夹来源“/ Users / xxx / Desktop / PC 1” 文件夹目的地“/ Users / xxx / Desktop / PC 1 / xxx / video folder”

要移动的文件是.mov文件。

2 个答案:

答案 0 :(得分:1)

Finder不应该遇到路径中的空格问题。

tell application "Finder"

 # Specifying Applescript path to an existing object:
 # alias "path:to:folder:file.mov"
 set destFolder to alias (((path to desktop) as text) & "PC 1:video folder")
 set movFile to alias (((path to desktop) as text) & "PC 1:test.mov")

 move movFile to destFolder
end tell

答案 1 :(得分:0)

好的,找到了解决方案:

do shell script ("startPath=\"$HOME/Desktop\"
fileName=\"video file.mov\"
destPath=\"$startPath/video folder.pkg/MOVIE DATA folder\"
cp \"$startPath/$fileName\" \"$destPath\"")