Copy link to clipboard
Copied
Ok i thought i had this working but apparently i did not. How can i get this to Search for only each object that's checked in the check box? and Display a dialog box telling what all has been changed when certain check boxes are checked. RunCH1, RunCH2, and RunCH3 are the names of the check boxes i have. I thought i had the find/replace working yesterday but i must have not been paying attention. it will do the first set of changes and teh second but it will not do the 3rd change. and no matter which one i have selected (or not selected) i get all 3 alert messages. I only want the alert message for the selected change. If you need the rest of teh code let me know and i'll paste it below. Thanks in advance.
// How do i make each CHECK BOX RunCH1/2/3 Only work when they are selected? I cannot figure out how to make 2&3 Work.
if(myResult == 1 && (RunCH1.value==true || RunCH2.value==true || RunCH3.value==true) ){
alert("Find and Replace Items Have been made.!")
Replace_TXT(" <CR> ", "^p");
Replace_TXT(" <CR>", "^p");
Replace_TXT(" ", " ");
Replace_TXT(" :", ":");
Replace_TXT(" .", ".");
Replace_TXT("^p^p", "^p");
if(myResult == 2 && (RunCH2.value==true ) );
Replace_TXT ("test", "asdfasdfasdfadsfasdfasdfasdfadfasdfasdf");
{
alert ("RunCH2 Changes Made")
};
if(myResult == 3 && (RunCH3.value==true) ){
Replace_TXT("and", "TEST");
}
alert ("RunCH3 Changes Made")
};
w.close(true);
function Replace_TXT(input, output)
{
app.findChangeTextOptions.caseSensitive = true;
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat = input;
app.changeTextPreferences.changeTo = output;
app.activeDocument.changeText();
}
try this with your main script file what you posted in other thread.. i think your requirement is big.. the myResult==1 is used whether we pressed ok and 2 is for we pressed cancel.. hope you understood now
...// How do i make each CHECK BOX RunCH1/2/3 Only work when they are selected? I cannot figure out how to make 2&3 Work.
if(myResult == 1 && (RunCH1.value==true)){
alert("Find and Replace Items Have been made.!")
Replace_TXT(" <CR> ", "^p");
Replace_TXT(" <CR>", "^p");
Replace_TXT(" ",
Copy link to clipboard
Copied
try this with your main script file what you posted in other thread.. i think your requirement is big.. the myResult==1 is used whether we pressed ok and 2 is for we pressed cancel.. hope you understood now
// How do i make each CHECK BOX RunCH1/2/3 Only work when they are selected? I cannot figure out how to make 2&3 Work.
if(myResult == 1 && (RunCH1.value==true)){
alert("Find and Replace Items Have been made.!")
Replace_TXT(" <CR> ", "^p");
Replace_TXT(" <CR>", "^p");
Replace_TXT(" ", " ");
Replace_TXT(" :", ":");
Replace_TXT(" .", ".");
Replace_TXT("^p^p", "^p");
}
if(myResult == 1 && (RunCH2.value==true ) ){
Replace_TXT ("test", "asdfasdfasdfadsfasdfasdfasdfadfasdfasdf");
alert ("RunCH2 Changes Made")
};
if(myResult == 1 && (RunCH3.value==true) ){
Replace_TXT("and", "TEST");
alert ("RunCH3 Changes Made")
};
w.close(true);
function Replace_TXT(input, output)
{
app.findChangeTextOptions.caseSensitive = true;
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat = input;
app.changeTextPreferences.changeTo = output;
app.activeDocument.changeText();
}
Copy link to clipboard
Copied
You my friend are a miracle worker. Thanks again.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now