Applescript 一个命令中有两种文件路径类型?

Applescript 一个命令中有两种文件路径类型?,applescript,Applescript,我一直在努力制作一个基本程序,将选定的文件复制到预定的位置。但是,它总是以具有两种不同路径类型的命令结束。有没有什么方法可以绕过这个问题,因为它困扰着我,我已经完成了程序的所有其他方面 set targetFolder to (POSIX path of (path to home folder)) & "Library/Application Support/..." as POSIX file set filepath to POSIX path of (choose file w

我一直在努力制作一个基本程序,将选定的文件复制到预定的位置。但是,它总是以具有两种不同路径类型的命令结束。有没有什么方法可以绕过这个问题,因为它困扰着我,我已经完成了程序的所有其他方面

set targetFolder to (POSIX path of (path to home folder)) & "Library/Application Support/..." as POSIX file

set filepath to POSIX path of (choose file with prompt "Chose your file")

delay

do shell script "cp " & filepath & space & targetFolder

delay

display dialog "Your file has been moved!"

这和你的问题完全一样:你没有读过我的答案吗?必须使用带引号的POSIX路径

set applicationSupportFolder to POSIX path of (path to application support folder from user domain)
set filepath to POSIX path of (choose file with prompt "Chose your file")
do shell script "cp " & quoted form of filepath & space & quoted form of applicationSupportFolder
而且您不需要任何延迟。

可能会重复