ApplescriptObjC文件夹的路径

ApplescriptObjC文件夹的路径,applescript,Applescript,我目前正在设置ApplescriptObjC应用程序。每当我尝试其他方法时,它就会出错。我正在尝试将其设置为shell脚本使用mv命令将文件从“Files”目录移动到/usr/bin/文件夹。我想它会有点像:doshell脚本“sudomv”&path&“/Files//usr/bin/”其中path就是我的路径。我已经尝试了我和posix的路径和其他东西,只是不起作用![文件文件夹包含我要移动到的文件/usr/bin]文件夹所在位置的图像:首先,屏幕截图中的文件夹文件是Xcode中的虚拟文件夹

我目前正在设置ApplescriptObjC应用程序。每当我尝试其他方法时,它就会出错。我正在尝试将其设置为shell脚本使用mv命令将文件从“Files”目录移动到/usr/bin/文件夹。我想它会有点像:
doshell脚本“sudomv”&path&“/Files//usr/bin/”
其中path就是我的路径。我已经尝试了我和posix的路径和其他东西,只是不起作用![文件文件夹包含我要移动到的文件/usr/bin]文件夹所在位置的图像:

首先,屏幕截图中的文件夹
文件
是Xcode中的虚拟文件夹(黄色)。 您必须创建一个真正的文件夹(蓝色)。最简单的方法是将Finder中的文件夹拖到Xcode侧栏,然后选择“创建文件夹引用”

要在AppleScript中使用
sudo
,请将具有管理员权限的
附加到
do shell脚本
行。系统将提示您输入管理员密码

此代码将(!)文件移动到
/usr/bin
。如果要复制(复制)文件,请使用
cp-r
而不是
mv

   set filesFolder to (current application's NSBundle's mainBundle()'s resourcePath()'s stringByAppendingPathComponent:"Languages") as text
   tell application "System Events" to set filesToMove to name of files of folder filesFolder
   repeat with aFile in filesToMove
     do shell script "/bin/mv " & quoted form of (filesFolder & "/" & aFile) & space & "/usr/bin/" with administrator privileges
   end repeat