admin管理员组

文章数量:1542928

Document对象是你打开或新建的一个文件,Documents是指Phtoshop中包含的所有Document的集合。


Documents

方法参数类型返回值功能
add
([width] > 宽度
[, height] > 高度
[, resolution] > 分辨率
[, name] > 文档名
[, mode] > 颜色模式
[, initialFill] > 背景填充内容 
[,pixelAspectRatio] > 像素长宽比
[, bitsPerChannel] > 位元深度
[,colorProfileName]) > 颜色配置文件 
 
UnitValue
UnitValue
number
string
NewDocumentMode
DocumentFill
number [0.1..10.00]
BitsPerChannelType
string
document创建一个新的空白文档
pixelAspectRatio: 默认值是 1.0,方形像素.
bitsPerChannelType: 默认值是 BitsPerChannelType.EIGHT.
getByName
(name) > 文档名
 
string
document从打开的所有文档中搜索文档名称等于搜索参数的第一个匹配文档。

属性参数类型功能
lengthnumber只读。应用中打开的文档总数。
parentapplication只读。从属应用。
typename string只读。引用的文档类型。


Document


属性参数类型功能
activeChannelsarray of channel读-写。被选择的通道。
activeHistoryBrushSource          guide读-写。历史记录画笔使用的历史记录。
activeHistoryStateguide读-写。被选择的历史记录。
activeLayerartlayer or  layerset读-写。被选择的图层。
artLayersartlayers只读。图层的集合。
backgroudLayerartlayer只读。文档的背景图层。
bitsPerChannelbitsPerChannelType读写。位元深度。
channelschannels只读。通道的集合。
colorProfileNamestring读-写。颜色配置文件的名字。只有当 colorProfileType=colorProfile.Custom or Working 时才有效。
colorProfileTypecolorProfileType读-写。文件是否使用工作的颜色配置文件,自定义配置文件,或没有配置文件。
colorSamplerscolorSamplers只读。与此文档的相关的当前颜色取样器。
componentChannelsarray of Channel只读。组成文档的颜色通道;例如,组成RGB文档的红色、绿色和蓝色通道。
countItemscountItems只读。当前计数项目。
fullNamefile只读。文档的完整路径。
guidesguides只读。参考线集合。
heightunitValue只读。文档的高度。
histogramarray of number只读。在直方图每个颜色的强度水平的复合渠道显示的像素的数量。该数组包含256个成员。
historyStateshistoryStates只读。历史记录集合。
infoDocumentInfo只读。文档的元数据。
layerCompslayerComps只读。组合图层的集合。
layerSetslayerSets只读。图层组集合。
managedboolean只读。是否是工作组文件。
measurementScalemeasurementScale只读。文档的测量标尺,只能在扩展版中使用。
modeDocumentMode只读。颜色配置文件。
namestring只读。文档的名称。
parentapplication只读。附属的应用程序。
pathFile只读。文档中的路径。
pathItemspathItems只读。路径项目集合。
pixelAspectRationumber
[0.100..10.000 ]
读写。像素长宽比(自定义)。
printSettingsDocumentPrintSettings 只读。文档的打印设置。


方法参数类型返回值功能
autoCount
(channel,
threshold)
 
chnnel
number
 计数文档中的对象的数量。只在扩展版本。
创建一个对象,每个对象countitem计数。
changeMode
(destinationMode    
[,options])
 
changemode
BitmapConversionOptions
or IndexedConversionOptions
 改变文档的颜色配置。
close
([saving])
 
saveOptions
 关闭文档。如果文档内容改变了,脚本提供了三个选项:保存、
不保存、提示保存。(默认:SaveOptionsType.prompttosavechanges)。
convertProfile
(destinationProfile,
intent
[,blackPointCompensation]
[,dither])
 
string
intent
boolean
boolean
 改变颜色配置。目标配置文件参数必须是一个字符串, color mode or Working RGB, Working CMYK,Working Gray, Lab Color(意为其中一个工作色彩空间或Lab颜色)。
crop
(bounds
[, angle]
[, width]
[, height])
 
array of 4 unitValue
number
unitValue
unitValue
 画布裁剪。参数bounds是裁剪后四边剩余的距离数组,[左,右,上,下]。
duplicate
([name ]
[,mergeLayersOnly]
)
 
string
boolean
Document创建文档对象的副本。
可选参数name为复制文档提供了名称。
可选参数mergelayersonly指示是否仅复制合并的图层。
exportDocument
(exportIn
[, exportAs]
[, options])
 
file
exportType
ExportOptionsIllustrator or ExportOptionsSaveForWeb
 将文档中的路径导出为一个AI文件,或将文件存储为WEB格式
这相当于选择文件>导出>路径到Illustrator,或文件>存储为Web所用格式。
flatten()  合并文档里的所有图层。
flipCanvas
(derection)
direction 在指定方向上翻转图像。
importAnnotations
(file)
file 将注释导入到文档中。
mergeVisibleLayers()  合并文档中可见的图层。
paste
([intoSelection])
booleanartLayer将剪贴板的内容粘贴到文档中。如果可选参数设置为“真”,并且有一个选区被激活,就可以将内容粘贴到选区中。
print
([sourceSpace]
[, printSpace]
[, intent]
[blackPointCompensation])
 
SourceSpaceType
string
Intent
boolean
 打印文档。
printSpace specifies the color space for the printer. Valid values are nothing (that is, the same as the source); or Working RGB, Working CMYK, Working Gray, Lab Color (meaning one of the working color spaces or Lab color); or a string  specifying a specific colorspace (default is same as source).
printOneCopy()  打印文档的副本。
rasterizeAllLayers()  栅格化所有图层。
recordMeasurements
([source]
[, dataPoints])
measurementSource
array of string
 记录文件的测量。
resizeCanvas
([width]
[, height]
[, anchor])
unitValue
unitValue
AnchorPosition
 改变画布的大小来显示图像的或多或少,但不改变图像的大小
resizeImage
([width]
[, height]
[, resolution]
[, resampleMethod]
[, amount])
UnitValue
UnitValue
number
ResampleMethod
number
 改变图像的大小。
amount参数可以控制噪点的数量(范围:0 - 100)when using preserve details。
revealAll()  展开文档以显示裁剪的部分。
rotateCanvas
(angle)
  顺时针方向旋转画布(包括图像)。
save()  保存。
saveAs
(saveIn
[, options]
[, asCopy]
[, extensionType])
File
object (see description)
boolean
Extension
 保存文档到指定格式。
通过将这些对象中的一个指定为适当的保存选项::
BMPSaveOptions
DCS1_SaveOptions
DCS2_SaveOptions
EPSSaveOptions
GIFSaveOptions
JPEGSaveOptions
PDFSaveOptions
PhotoshopSaveOptions
PICTFileSaveOptions
PICTResourceSaveOptions
PixarSaveOptions
PNGSaveOptions
RawSaveOptions
SGIRGBSaveOptions
TargaSaveOptions
TiffSaveOptions
splitChannels() array of Document将文档通道拆分为单独的图像。
suspendHistory
(historyString
javaScriptString)
string > 历史记录的名称
javascriptstring
 为一段动作创建一个历史记录。
trap
(width)
number 适用于捕捉到CMYK文档。
仅当docref.mode = documentmode.cmyk。
trim
([type]
[, top]
[, left]
[, bottom]
[, right])
TrimType
boolean
boolean
boolean
boolean
 在画布的指定方向,修建空白透明的区域
    

本文标签: 脚本属性对象事件操作