0

为了将 .MOV 文件 (h.264) 导入 Final Cut Pro,我需要一个与 .MOV 文件名相同的对应 .THM 文件。是否可以使用 AppleScript 或 Automator 执行此操作?这是我想做的事情:

  1. 创建一个已存在于我的 HD 上的“TEMPLATE.THM”文件的副本
  2. 使用 .MOV 文件名重命名“TEMPLATE.THM”文件
  3. 对 .MOV 文件的文件夹执行此操作,为每个具有相同文件名的 .MOV 文件创建一个 .THM 文件。
4

1 回答 1

1

G'day

这可能不是最快的方法 - 但我看到您仍在等待答案 - 所以这里有一些可以帮助您入门的方法。在查找器中选择所有 MOV 文件并在脚本编辑器中运行它。

set theTemplate to "Macintosh HD:Users:[user name]:[folder:location]:TEMPLATE.THM"

tell application "Finder"
  set theFiles to selection
  repeat with thisFile in theFiles
    set thisName to name of thisFile
    set theFolder to container of thisFile
    set newFile to duplicate theTemplate to theFolder

    set text item delimiters of AppleScript to "."
    set thisName to text item 1 of thisName
    set text item delimiters of AppleScript to ""

    set newName to (thisName & ".THM")
    set name of newFile to newName
  end repeat
end tell

获取模板路径的最简单方法是在查找器中选择它并运行:

tell application "Finder"
    set theFile to selection as string
end tell

That will put the path in your results window — just copy it into the first line of the script above.

Hope that helps

m.

于 2011-11-24T22:45:51.963 回答