PhotoShop中显示当前PS信息的脚本

首先在对话框中显示PS的信息有版本号、安装路径、可使用内存,单击确定之后,会弹出是否设置前景色与背景色的提示,单击OK,会设置其为随机色。

//Create a Welcome message
// Use the name and version properties of the application object to
// Append the application’s name and version to the Welcome message
// use "\r" to insert a carriage return
// use the combination operator += to append info to the message
var message = "Welcome to " + app.name
message += " version " + app.version + "\r\r"
// find out where Adobe Photoshop CS5 is installed
// and add the path to the message
// add the optional parameter fsName to the path property
// to display the file system name in the most common format
message += "I’m installed in " + app.path.fsName + "\r\r"
// see how much memory Adobe Photoshop CS5 has to play with
message += "You have this much memory available for Adobe Photoshop CS5: " +
app.freeMemory + "\r\r"
// use the length property of the documents object to
// see how many documents are open
var documentsOpen = app.documents.length
message += "You currently have " + documentsOpen + " document(s) open.\r\r"
// display the message to the user
alert(message)
// answer will be true for a "Yes" answer and false for a "No" answer
var answer = confirm("Set the foreground and background to my favorite colors?")
// set the colors
if (answer) {
// I don’t have a favorite color. Why did I ask you may wonder?
app.foregroundColor.rgb.red = Math.random() * 255
app.foregroundColor.rgb.green = Math.random() * 255
app.foregroundColor.rgb.blue = Math.random() * 255
app.backgroundColor.rgb.red = Math.random() * 255
app.backgroundColor.rgb.green = Math.random() * 255
app.backgroundColor.rgb.blue = Math.random() * 255
}
// Open a document
if (app.documents.length == 0) {
// use the application’s path and the offset to the samples folder
var sampleDocToOpen = File(app.path + "/Samples/Fish.psd")
// compose a message with the name of the file
message = "Would you like me to open a sample for you? ("
message += sampleDocToOpen.fsName
message += ")"
// ask the user another question
answer = confirm(message)
// open the document accordingly
if (answer) {
open(sampleDocToOpen)
}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值