Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting
Moderators: Tom , Kukurykus
mead
Posts: 20 Joined: Sat Jul 23, 2022 12:28 am
Post
by mead » Tue Aug 23, 2022 11:48 am
Code: Select all
#target photoshop
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
function Action1() {
// Batch
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putPath(cTID('null'), new File("~/Desktop/x1"));
var ref1 = new ActionReference();
ref1.putName(cTID('Actn'), "C:/Users/Administrator/Desktop/X.jsx");
ref1.putName(cTID('ASet'), "C:/Users/Administrator/Desktop/X.jsx");
desc1.putReference(cTID('Usng'), ref1);
executeAction(cTID('Btch'), desc1, dialogMode);
};
step1(); // Batch
};
Action1.main = function () {
Action1();
};
Action1.main();
Batch Loop for javascript
can use javascript run Batch ?
Kukurykus
Posts: 528 Joined: Mon Jul 25, 2016 12:36 pm
Post
by Kukurykus » Tue Aug 23, 2022 5:23 pm
Replace paths for 'Actn' and 'ASet' to your Action name and ActionSet name.
mead
Posts: 20 Joined: Sat Jul 23, 2022 12:28 am
Post
by mead » Wed Aug 24, 2022 12:02 am
But I don't want to use action
Direct use of javascript
Kukurykus
Posts: 528 Joined: Mon Jul 25, 2016 12:36 pm
Post
by Kukurykus » Wed Aug 24, 2022 1:47 pm
The code is made from Photoshop Batch that uses actions, not scripts.
mead
Posts: 20 Joined: Sat Jul 23, 2022 12:28 am
Post
by mead » Wed Aug 24, 2022 2:41 pm
Ok, thank you, can again ask you a question?
Code: Select all
var wbe1= File ('~/desktop/' + '/psd.txt');
wbe1.open("r");
var ps = wbe1.read();
var imageNm = ps
for (var i = 0; i < imageNm.length; i++) {
alert(imageNm[i], " ");
}
txt content :123,234,345
How to use alert Prompt, respectively,
I hope prompt :123
234
345
Array respectively hints
Kukurykus
Posts: 528 Joined: Mon Jul 25, 2016 12:36 pm
Post
by Kukurykus » Thu Aug 25, 2022 9:12 am
Code: Select all
with(File(Folder.desktop + '/psd.txt')) open('r'), r = read(), close()
lngth = (splt = r.split(',')).length; while(shft = splt.shift())
prompt((lngth - splt.length) + ':', shft)
mead
Posts: 20 Joined: Sat Jul 23, 2022 12:28 am
Post
by mead » Thu Aug 25, 2022 12:05 pm
thank you
Kukurykus
Posts: 528 Joined: Mon Jul 25, 2016 12:36 pm
Post
by Kukurykus » Fri Aug 26, 2022 6:02 am
Could you explain in the other thread (
Does not support Spaces ) how exactly you paste the link, that it gets img markers? Step after step...