javascript - 这个 *.open();*.write();*.close(); 是哪个对象,或者api对象的方法?
迷茫
迷茫 2017-04-11 09:55:30
[JavaScript讨论组]

这个问题,我问了一遍了,这是 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

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

全部回复(1)
伊谢尔伦

ExtendScript的API,
http://www.adobe.com/devnet/s...
其中那个JavaScript Tools Guide。
3 File System Access那一章

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号