这个 *.open();*.write();*.close(); 是哪个对象,或者api对象的方法?

这个问题,我问了一遍了,这是 Photoshop 的jsx脚本 , 这个脚本和 js 差不多.
问题如下:
链接描述

var fileOut = new File("R:\\jsdemo.log");    //定义一个变量[fileOut],表示硬盘上某个路径的文件。通道的文本信息将写入到这个文件。
fileOut.open("w", "TEXT");    //设置文件的操作模式为写入模式。
fileOut.write("New ..................");    //写入到文本文件里。
fileOut.close();    //文件写入成功后,关闭文件的输

我想知道,这个 .open();.write();*.close(); 是哪个对象,或者api对象的方法?

别人的回答我没找到,可能是我不会找,谁帮我看看,

这个 file 对象,除了 open write close 等,还有哪些方法呢?这些方法的参数是什么?

JavaScript support in Adobe Photoshop CS5
For a JavaScript file to be recognized by Photoshop as a valid script file, it must use either a .js or a .jsx

extension.
On the Mac OS, there is no difference in the way scripts with the two extensions function. On Windows, if
the script files is opened from inside Photoshop, there is no difference between using the .js and .jsx

  1. However, if the script is launched by double-clicking on it, a script with the .js extension is

  2. with the Microsoft JScript engine, and it cannot launch Adobe Photoshop CS5. For Windows,

using the .jsx extension is preferrable, since it interprets the script with the ExtendScript engine.
All of the Adobe Creative Suite 5 applications, including Adobe Photoshop CS5, use ExtendScript, Adobe’s
extended implementation of JavaScript. ExtendScript files are distinguished by the .jsx extension.
ExtendScript offers all standard JavaScript features, plus additional features and utilities, such as:
● A debugging environment (the ExtendScript Toolkit)
● A localization utility
● Tools that allow you to combine scripts and direct them to particular applications
● Platform-independent file and folder representation
Many of the JavaScript objects and methods use objects defined in ExtendScript, such as the File object,
the Folder object, and the UnitValue object. For that reason, using the .jsx extension for your script
files is preferable.
For details of these and additional features, see the JavaScript Tools Guide CS5. This document is installed
with Creative Suite 5 applications at these locations:
● In Windows:
C:Program FilesAdobeAdobe UtilitiesExtendScript Toolkit CS5SDK

阅读 4.3k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题