1

Filemaker 可以使用 AppleScript。

在 Filemaker 中,我想创建一个包含 6 个子文件夹的新文件夹(名称为 FileMaker 字段)。

在 Applescript 方面,我是一个完全的菜鸟。

到目前为止,这是我的脚本:

tell application "FileMaker Pro Advanced"
set folder_name to cell "FolderName" of current record
end tell
tell application "Finder"
     activate
     make new folder at folder "Desktop" of folder "dick" of folder "Users" of startup disk with properties {name:folder_name}
end tell
tell application "Finder"
     activate
        make new folder at folder {name:folder_name} of folder "Desktop" of folder "dick" of folder "Users" of startup disk with properties {name:"subfolder"}
end tell

我的问题是:创建“Subfolder1”

我的错误是什么?

非常感谢帮助

4

2 回答 2

2

当您创建一个新文件夹时,您可以定义各种属性,但在引用文件夹时只需使用名称,例如:

make new folder at folder folder_name of folder "Desktop" of folder "dick" of folder "Users" of startup disk with properties {name:"subfolder"}

请注意,创建新文件夹返回的结果是对该文件夹的引用,因此您还可以执行以下操作:

tell application "Finder"

  set newFolder to (make new folder at folder "Desktop" of folder "dick" of folder "Users" of startup disk with properties {name:folder_name})

  make new folder at newFolder with properties {name:"subfolder"}

end tell
于 2012-11-02T02:51:38.123 回答
2

这是另一种方法:

set myPath to POSIX path of ((path to desktop as text) & folder_name & ":subfolder")
do shell script "mkdir -p " & myPath
于 2012-11-05T02:36:34.803 回答