This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.writeln("Hello World!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credits: Tom Ruark | |
// Switch OFF ScriptingListener output | |
var listenerID = stringIDToTypeID("AdobeScriptListener ScriptListener"); | |
var keyLogID = charIDToTypeID('Log '); | |
var d = new ActionDescriptor; | |
d.putBoolean(keyLogID, false); | |
executeAction(listenerID, d, DialogModes.NO); | |
// Switch ON ScriptingListener output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function s(str) { return stringIDToTypeID(str) } | |
var ref = new ActionReference(); | |
ref.putProperty(s('property'), s('presetManager')); | |
ref.putEnumerated(s('application'), s('ordinal'), s('targetEnum')); | |
var desc = executeActionGet(ref).getList(s('presetManager')); | |
var presetDesc = undefined, | |
lists = desc.count; | |
for (var i = 0; i < lists; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS file (panel) | |
var sharpeningStrength = 225; | |
csInterface.evalScript('addSharpeningForWeb(' + sharpeningStrength + ')'); | |
// JSX file (Photoshop) | |
function addSharpeningForWeb(strength) { | |
// ... you can now use the strength param here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JSX file (Photoshop) | |
function addSharpeningForWeb() { | |
// ... smart Photoshop scripting code here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS file (panel) | |
csInterface.evalScript('addSharpeningForWeb()'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS file (panel) | |
var csInterface = new CSInterface(); | |
csInterface.evalScript('alert("Hello World!")'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS file (panel) | |
var csInterface = new CSInterface(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS file (panel) | |
// ... | |
csInterface.evalScript('addSharpeningForWeb(' + paramString + ')', function(res) { | |
// "res" is the response that comes from Photoshop | |
}); | |
// JSX file (Photoshop) | |
function addSharpeningForWeb(paramObj) { | |
// ... lots of code here | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS file (panel) | |
// ... | |
csInterface.evalScript('getDocumentInfo()', function(res) { | |
var resObj = JSON.parse(res); | |
// you have now access to the same docInfo object | |
}); | |
// JSX file (Photoshop) | |
function getDocumentInfo() { | |
//... I just make up data here... |
OlderNewer