Copy link to clipboard
Copied
This is my script when we run it opens a message like this in photoshop
i have problem in updating the information in scripts always..
what i need is if i update in notepad or word or any file it should show the information in photoshop
how to add path in this script?
for example:
/xxx WORKING FOLDER/01 WORKING/03 SCRIPTS/PLUGIN SCRIPTS/update.rtf');
need a code to run this help me please
i will save info on the update .rtf when i run the script the info in the update.rtf need to be run on photoshop
It seems, your path to your file is wrong.
Please put the file for testing on your desktop ( like I wrote before! ) and replace this part of code
var txt = File ('~/Desktop/test.txt');
txt.open("r");
var contentStr = txt.read();
txt.close();
var str = contentStr.split ("\n");
with these lines before you run the script again
...var txt = File ('~/Desktop/test.txt');
if (txt.exists == true) {
txt.open("r");
var contentStr = txt.read();
txt.close();
var str = contentStr.split ("\n");
} else { alert ("no text file f
Copy link to clipboard
Copied
Not sure what you mean by adding a path to the script. Are you talking about being able to select a file via the UI, and or having the path show in the UI?
Copy link to clipboard
Copied
var dlgMain = new Window('dialog', 'CURRENT UPDATES');
dlgMain.marginLeft = 15;
dlgMain.center();
dlgMain.alertBtnsPnl = dlgMain.add('panel',undefined, '');
dlgMain.alertBtnsPnl.alignment='left';
dlgMain.alertBtnsPnl.preferredSize = [200,200];
dlgMain.alertBtnsPnl.cmb= dlgMain.alertBtnsPnl.add("group");
dlgMain.alertBtnsPnl.cmb.orientation = 'column';
dlgMain.alertBtnsPnl.cmb.alignChildren = 'fill';
dlgMain.alertBtnsPnl.cmb.alignment = 'left';
dlgMain.alertBtnsPnl.alignChildren = "left";
dlgMain.alertBtnsPnl.mh= dlgMain.alertBtnsPnl.add("group");
dlgMain.alertBtnsPnl.mh.orientation = 'column';
dlgMain.alertBtnsPnl.mh.alignChildren = 'fill';
dlgMain.alertBtnsPnl.mh.alignment = 'left';
with (dlgMain.alertBtnsPnl) {
cmb.txt = cmb.add('statictext', undefined, '');
cmb.txt.preferredSize = [1,1];
mh.add('statictext', undefined, 'UPDATES: ');
mh.add('statictext',undefined, '1. If received ins. "Convert to CMYK. Background to be 5M 5Y. Profile is ISONewspaper26v4. keep as much hair detail as possible".');
mh.add('statictext',undefined, ' Need to do Convert to CMYK. Background to be 5M 5Y. Profile is ISONewspaper26v4. keep as much hair detail as possible.');
}
dlgMain.show();
this is the code im using when i run the code it shows the result which i have posted below screenshot.
what i need is simple thing,
if i want to update the info i needed to open the code again and i have to add points in the code
instead of that if i add information in excel or word document that should automatically should run when the script runs
Copy link to clipboard
Copied
Thanks for the text!
Helas I'm not very good - in English and script
I leave room for others ......
Copy link to clipboard
Copied
var dlgMain = new Window('dialog', 'CURRENT UPDATES');
dlgMain.marginLeft = 15;
dlgMain.center();
dlgMain.alertBtnsPnl = dlgMain.add('panel',undefined, '');
dlgMain.alertBtnsPnl.alignment='left';
dlgMain.alertBtnsPnl.preferredSize = [200,200];
dlgMain.alertBtnsPnl.cmb= dlgMain.alertBtnsPnl.add("group");
dlgMain.alertBtnsPnl.cmb.orientation = 'column';
dlgMain.alertBtnsPnl.cmb.alignChildren = 'fill';
dlgMain.alertBtnsPnl.cmb.alignment = 'left';
dlgMain.alertBtnsPnl.alignChildren = "left";
dlgMain.alertBtnsPnl.mh= dlgMain.alertBtnsPnl.add("group");
dlgMain.alertBtnsPnl.mh.orientation = 'column';
dlgMain.alertBtnsPnl.mh.alignChildren = 'fill';
dlgMain.alertBtnsPnl.mh.alignment = 'left';
with (dlgMain.alertBtnsPnl) {
cmb.txt = cmb.add('statictext', undefined, '');
cmb.txt.preferredSize = [1,1];
mh.add('statictext', undefined, 'UPDATES: ');
mh.add('statictext',undefined, '1. If received ins. "Convert to CMYK. Background to be 5M 5Y. Profile is ISONewspaper26v4. keep as much hair detail as possible".');
mh.add('statictext',undefined, ' Need to do Convert to CMYK. Background to be 5M 5Y. Profile is ISONewspaper26v4. keep as much hair detail as possible.');
}
dlgMain.show();
this is the code im using when i run the code it shows the result which i have posted below screenshot.
what i need is simple thing,
if i want to update the info i needed to open the code again and i have to add points in the code
instead of that if i add information in excel or word document that should automatically should run when the script runs
Copy link to clipboard
Copied
Hi hardy11111​,
I'm not sure if I understand you correctly.
But perhaps this helps you a little:
// regards pixxxelschubser
/*//*********************************************************************************************************************************************
REQUIRED !!!
At first create a text file (plain text) on your desktop manually;
name -->
test.txt
contents -->
1. If received ins. "Convert to CMYK. Background to be 5M 5Y. Profile is ISONewspaper26v4. keep as much hair detail as possible".
Need to do Convert to CMYK. Background to be 5M 5Y. Profile is ISONewspaper26v4. keep as much hair detail as possible.
*///*********************************************************************************************************************************************
var txt = File ('~/Desktop/test.txt');
txt.open("r");
var contentStr = txt.read();
txt.close();
var str = contentStr.split ("\n");
var dlgMain = new Window('dialog', 'CURRENT UPDATES');
dlgMain.marginLeft = 15;
dlgMain.center();
dlgMain.alertBtnsPnl = dlgMain.add('panel',undefined, '');
dlgMain.alertBtnsPnl.alignment='left';
dlgMain.alertBtnsPnl.preferredSize = [200,200];
dlgMain.alertBtnsPnl.cmb= dlgMain.alertBtnsPnl.add("group");
dlgMain.alertBtnsPnl.cmb.orientation = 'column';
dlgMain.alertBtnsPnl.cmb.alignChildren = 'fill';
dlgMain.alertBtnsPnl.cmb.alignment = 'left';
dlgMain.alertBtnsPnl.alignChildren = "left";
dlgMain.alertBtnsPnl.mh= dlgMain.alertBtnsPnl.add("group");
dlgMain.alertBtnsPnl.mh.orientation = 'column';
dlgMain.alertBtnsPnl.mh.alignChildren = 'fill';
dlgMain.alertBtnsPnl.mh.alignment = 'left';
with (dlgMain.alertBtnsPnl) {
cmb.txt = cmb.add('statictext', undefined, '');
cmb.txt.preferredSize = [1,1];
mh.add('statictext', undefined, 'UPDATES: ');
//mh.add('statictext',undefined, '1. If received ins. "Convert to CMYK. Background to be 5M 5Y. Profile is ISONewspaper26v4. keep as much hair detail as possible".');
mh.add('statictext',undefined, str[0]);
//mh.add('statictext',undefined, ' Need to do Convert to CMYK. Background to be 5M 5Y. Profile is ISONewspaper26v4. keep as much hair detail as possible.');
mh.add('statictext',undefined, str[1]);
}
dlgMain.show();
If so
have fun
Copy link to clipboard
Copied
almost correct but when i run i can see anything content in it i getting blank
As im using mac and for txt i used rtf
the content inside the txt or rtf or word would display in the box when i run the script
Copy link to clipboard
Copied
When i run ur code using txt as you mentioned still empty box is showing while running
Copy link to clipboard
Copied
It seems, your path to your file is wrong.
Please put the file for testing on your desktop ( like I wrote before! ) and replace this part of code
var txt = File ('~/Desktop/test.txt');
txt.open("r");
var contentStr = txt.read();
txt.close();
var str = contentStr.split ("\n");
with these lines before you run the script again
var txt = File ('~/Desktop/test.txt');
if (txt.exists == true) {
txt.open("r");
var contentStr = txt.read();
txt.close();
var str = contentStr.split ("\n");
} else { alert ("no text file found") };
The result should be (if the file on your desktop was found):
-------------------------------------------------------------------------------
A rtf file is never a good idea. You really need plain text - and not a text with any kind of formatting!!!
Otherwise you get this wrong result:
Good luck
Copy link to clipboard
Copied
Hi sir,
In Windows it is working but in MAC we dont have txt file format we have only rtf file format so can you please help on tha
Copy link to clipboard
Copied
Txt file format is fine when i add another line in the txt file it doesnt work when i run i added
mh.add('statictext',undefined, str[1]);
extra line but it wont show when i run
Copy link to clipboard
Copied
You could format your script like this...
#target photoshop;
var content = """
UPDATES:
1. If received ins. Convert to CMYK.
Background to be 5M 5Y.
Profile is ISONewspaper26v4.
keep as much hair detail as possible.
Need to do Convert to CMYK.
Background to be 5M 5Y.
Profile is ISONewspaper26v4.
keep as much hair detail as possible.
""";
var dlgMain = new Window('dialog', 'CURRENT UPDATES',undefined,{closeButton: true});
dlgMain.alertBtnsPnl = dlgMain.add('panel',undefined, '');
dlgMain.alertBtnsPnl.alignment='left';
dlgMain.alertBtnsPnl.preferredSize = [200,200];
dlgMain.alertBtnsPnl.add('statictext',undefined, content,{multiline: true});
dlgMain.show();
Copy link to clipboard
Copied
Hi SuperMerlin​,
it seems hardy wants these lines not in the jsx. He wants an extra txt file for that.
hardy11111​,
you already have two lines in your txt?
A new line (after these two lines) will be str[2]
A new line (after these three lines) will be str[3]
and so on …
Copy link to clipboard
Copied
Bonjour
It would be better to show text rather than an image to make it easier for those who want to help ?