为什么 applescript 不接受本地化字符串命令中的文件对象?
Why applescript doesn't accept file object in localized string command?
以下 applescript 抛出错误:
set thePath to path to application support from user domain as alias
set mystr to localized string "Add people to this note" in bundle file thePath
错误是
error "Can’t make file (alias \"Macintosh HD:Users:shakes:Library:Application Support:\") into type file." number -1700 from file (alias "Macintosh HD:Users:shakes:Library:Application Support:") to file
这个错误是什么意思? localized string
需要一个 file
或 alias
对象,而 thePath
就是为什么这个错误?
仅供参考,localized string
reference 说:
Syntax
localized string text required
from table text optional
in bundle fileSpecifier optional
文件夹应用程序支持不是文件。删除 file
关键字。
set thePath to path to application support from user domain -- as alias is redundant
set mystr to localized string "Add people to this note" in bundle thePath
但是代码没有意义,因为文件夹 Application Support 也不是一个包。
以下 applescript 抛出错误:
set thePath to path to application support from user domain as alias
set mystr to localized string "Add people to this note" in bundle file thePath
错误是
error "Can’t make file (alias \"Macintosh HD:Users:shakes:Library:Application Support:\") into type file." number -1700 from file (alias "Macintosh HD:Users:shakes:Library:Application Support:") to file
这个错误是什么意思? localized string
需要一个 file
或 alias
对象,而 thePath
就是为什么这个错误?
仅供参考,localized string
reference 说:
Syntax
localized string text required
from table text optional
in bundle fileSpecifier optional
文件夹应用程序支持不是文件。删除 file
关键字。
set thePath to path to application support from user domain -- as alias is redundant
set mystr to localized string "Add people to this note" in bundle thePath
但是代码没有意义,因为文件夹 Application Support 也不是一个包。