问题描述
我工作的一个简单的AppleScript,使一个iMovie项目文件的副本。我加入这个属性的脚本:
I'm working on a simple AppleScript to make a copy of an iMovie project file. I have added this property to the script:
property iMovieProjects : alias (home directory of (system info) as string) & "Movies:iMovie Projects"
这给我的错误
文件别名的Macintosh HD:用户:我的用户名:电影:中没有被发现的iMovie项目
什么是正确的道路?我试过的iMovie Project.localized但这并不能工作。
What's the correct path? I tried iMovie Project.localized but that doesn't work either.
推荐答案
试试这个,貌似你需要使用搜索引擎。此外,我加了一点简化上获得主路径。
Try this, looks like you need to use the Finder. Also i added a little simplification on getting the home path.
property iMovieProjects : ""
tell application "Finder" to set iMovieProjects to alias ((home as string) & "Movies:iMovie Projects")
修改:继承人不使用Finder的基础上,从思想和mklement0放一条线解决方案; regulus6633 的
property iMovieProjects : alias ((path to movies folder as text) & "iMovie Projects.localized")
看来这个文件夹是某种特殊的捆绑类型的文件夹和这就是为什么我们需要取景器正确解析它。充分利用其.localized名称解析它。
It appears this folder is some kind of special bundle type folder and thats why we were needing the finder to parse it correctly. Using its full .localized name resolves it.
这篇关于什么是一个AppleScript使用正确的路径的iMovie项目文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!