我们有一个应用程序“MyApp”,它提供了可以通过AppleScript调用的方法套件的字典。一种这样的方法是“保存图片”,我可以称之为:
save picture "picfilename.jpg"
我想要做的是添加一个额外的LONG参数来指定图片分辨率,因此调用将变为:
save picture "picfilename.jpg" resolution 300
为此,我尝试将参数添加到包含函数套件的.R文件中。
“save picture“,
“saves a picture",
‘SVPC’,
kAESavePict,
typeBoolean,
“Returns TRUE when successful“,
replyRequired, singleItem, notEnumerated, notTightBindingFunction,
enumsAreConstants, enumListCanRepeat, replyIsValue,
reserved5, verbEvent, reserved, reserved, reserved,
typePString,
"",
directParamRequired, singleItem, notEnumerated, doesntChangeState, enumsAreConstants, enumListCanRepeat, directParamIsValue, directParamIsTarget,
reserved8,
{
/* NEW CODE */
“resolution”,
‘RESO’,
typeInteger,
"Device Handle",
optional,
singleItem,
notEnumerated,
reserved, reserved, reserved, reserved,
reserved, reserved, reserved, reserved,
reserved, reserved, reserved, reserved,
reserved
},
但问题是我在编译期间遇到了格式错误的表达式错误(rez)。任何想法上述陈述中的问题是什么?当我删除括号内的 NEW CODE 时,它会编译文件。