在 AppleScript 中使用的 iMovie Projects 文件夹的正确路径是什么

编程入门 行业动态 更新时间:2024-10-17 02:58:52
本文介绍了在 AppleScript 中使用的 iMovie Projects 文件夹的正确路径是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在编写一个简单的 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:Users:我的用户名:Movies:iMovie Projects of not found

File alias Macintosh HD:Users:my user name:Movies:iMovie Projects of wasn't found

正确的路径是什么?我试过 iMovie Project.localized 但这也不起作用.

What's the correct path? I tried iMovie Project.localized but that doesn't work either.

推荐答案

试试这个,看来你需要使用 Finder.此外,我还对获取主路径进行了一些简化.

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 Projects 文件夹的正确路径是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-17 14:15:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/915835.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件夹   路径   正确   AppleScript   iMovie

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!