Copy link to clipboard
Copied
I am having a problem with scripts in Adobe Bridge not recognizing the command “prompt”.
I am on Windows 10, Bridge version 13.0.2.636.
I have been getting the errors: “prompt is not a function.” and “Expected: ;”
An example of one of my command lines is:
var PixSet == prompt(“LIST OF PROJECTS:\n\n<1> PHOTOS A\n\n<2> BOOK”, “1”);
I have rebooted, reinstalled and deleted preferences.
I have tried several different uses of the command with the same results.
At least one other person (Kukurykus on adobebridge.uservoice.com) has tried "prompt" in Bridge 2023 and has had no problems.
I'd do things a bit differently. Use a custom window with a drop-down list, and a.switch statement is better than a long line of ifs. But yeah, == means is equal to, = means make equal to.
Copy link to clipboard
Copied
I also get the error “prompt is not a function.” running your example on Windows 10, Bridge version 13.0.2.636
I have tried other prompts with the same resut. I haven't seen “Expected: ;” yet.
This seems to be a Bridge 2023 bug because your example runs without a problem in 2022 (12.0.4.286).
Copy link to clipboard
Copied
Prompt is NOT a function. The proper use is Window.prompt() and the same goes for alert boxes.
Understand that Window.prompt was partially broken in past versions, I bugged it a while back because formatting and behavior wasn't correct. But it should have always used the Window object.
Copy link to clipboard
Copied
Thank you.
I did try using "window.prompt()", but neglected to put that in my original text.
With or without the "window." prefix, I get an error.
Copy link to clipboard
Copied
Indeed, Window.prompt() does work (capital "W")
What is strange is that alert() works for me and always has. I just assumed confirm and prompt would too.
Thanks for the clarification @Lumigraphics
Copy link to clipboard
Copied
Yes alert() works in older versions of Bridge. This was just unsupported behavior that they must have tightened up.
Copy link to clipboard
Copied
I have tried it with and without a capital "W" and still get an error.
alert("TEXT") and Window.alert("TEXT") work fine. window.alert("TEXT") gives an error.
confirm behaves similarly.
Copy link to clipboard
Copied
This is a longshot, but the original command you posted uses curly quotes which does create an error for me. When I replace them with straight quotes it works.
var PixSet = Window.prompt("LIST OF PROJECTS:\n\n<1> PHOTOS A\n\n<2> BOOK", "1");
Copy link to clipboard
Copied
Thank you so much for patiently helping me with this.
I retyped the quotes just to be sure and I’m still getting the error.
Copy link to clipboard
Copied
No problem, we'll get this figured out.
Can you post the entire script you are testing?
Copy link to clipboard
Copied
Thank you.
Here is the script.
It runs on startup.
For whatever reason, I cannot attach the file, so I will paste it here:
var fileRef = "";
var docRef = "";
var PixSet == Window.prompt("LIST OF PROJECTS:\n\n<1> ORLICH FAMILY ALBUM\n\n<2> NOS BOOK\n\n<3> INFLIGHT BOOK\n\n<4> MISS 60 BIRTHDAY ART\n\n<5> FLATBED SCANS - HISTORICAL\n\n<6> POLICE LINE UP - SHARON FAMILY PIC\n\n<7> KARL JOHN CAVALRY\n\n<8> MARIE FORGET ME NOT\n\nEnter a number from 1 to 29", "1");
if (PixSet == 1) { PIXSET01();}
if (PixSet == 2) { PIXSET02();}
if (PixSet == 3) { PIXSET03();}
if (PixSet == 4) { PIXSET04();}
if (PixSet == 5) { PIXSET05();}
if (PixSet == 6) { PIXSET06();}
if (PixSet == 7) { PIXSET07();}
if (PixSet == 8) { PIXSET08();}
function PIXSET01() {
#target bridge
app.browseTo("/E/ORLICH-ALBUM-FILES/");
app.document.thumbnail = Folder("/E/work/20220921-ORLICH-BOOK-CORRECTIONS/");
}
function PIXSET02() {
#target bridge
app.browseTo("/D/PROJECTS/04-DREAMWEAVER/GBH/nos/nos2015-6spring/images/");
app.document.thumbnail = Folder("/D/PROJECTS/04-DREAMWEAVER/AllInternet/gbhsite/nos/nos2015-6spring/images/NOSTommyInTreeAa.jpg/");
app.document.thumbnail = Folder("/E/internet/20171205-olderWebPages/gbhcom/nos/nos2015-06spring/images/NOSTommyInTreeAa.jpg/");
app.document.thumbnail = Folder("/E/internet/gbh2site/nos/nos2015-6spring/images/NOSTommyInTreeAa.jpg/");
app.document.thumbnail = Folder("/E/NOS/G138-NOS/NOSNewspaperSpring2005/Images/");
app.document.thumbnail = Folder("/E/NOS/G138-NOS/NOSNewspaperSpring2005/Images/NOSTommyInTreeAa.psd/");
app.document.thumbnail = Folder("/E/NOS/G138-NOS/NOSNewspaperSpring2005/Images/TommyTreeProxyA.psd/");
app.document.thumbnail = Folder("/D/PROJECTS/02-BOOKS/20230304-NOS-BOOK-THIS-TIME-I-MEAN-IT/");
}
function PIXSET03() {
#target bridge
app.browseTo("/H/20120724-ARCHIVES/archive005-HPE500FxArchives201609/AllInternet/inflightDevelopment/inflyteSite20150130/thumbnailSearches/New folder/");
}
function PIXSET04() {
#target bridge
app.browseTo("/H/20120724-ARCHIVES/archive003-HPE500FxArchives201208/DVDstorage/PSeriesCDDVD/P-051-091/P066/GeneralPixClosed200606/MissOnMotorcycleTankXMas2003/");
app.document.thumbnail = Folder("/E/0-PROJECTS-BACKUP/PROJECTS-COMPLETED/00-MAGAZINES/20211210-MISS-20th-ANNIVERSARY/BOOK-ONE/");
app.document.thumbnail = Folder("/D/PROJECTS/03-GENERAL/20221110-MISS-60th-AND-VALENTINES/");
}
function PIXSET05() {
#target bridge
app.browseTo("/H/20120724-ARCHIVES/archive003-HPE500FxArchives201208/FlatbedAndMinoltaScans/");
}
function PIXSET06() {
#target bridge
app.browseTo("/D/PROJECTS/03-GENERAL/20221115-SHARON-FAMILY-PICTURE-AND-HARTIGS/");
app.document.thumbnail = Folder("/E/work/20221214-SHARON-FAMILY-PICTURE-AND-HARTIGS/");
}
function PIXSET07() {
#target bridge
app.browseTo("/D/PROJECTS/01-ALBUMS/HARTIG/01-KARL-JOHN/00-INDESIGN/");
}
function PIXSET08() {
#target bridge
app.browseTo("/E/work/20230308-AUNT-MARIE-FORGET-ME-NOTS/");
}
Copy link to clipboard
Copied
I think the problem is the two equal signs here: var PixSet == Window.prompt
Should be: var PixSet = Window.prompt
After that change, it works for me.
Copy link to clipboard
Copied
I'd do things a bit differently. Use a custom window with a drop-down list, and a.switch statement is better than a long line of ifs. But yeah, == means is equal to, = means make equal to.
Copy link to clipboard
Copied
I slid an extra equals sign into an old script at the time I was updating Bridge and blamed the new Bridge. Unbelievable. Thank you very, very much for your courtesy and patience. I hope that your next complainant has an actual problem.
Thank you for the switch suggestion.
Copy link to clipboard
Copied
No problem. I've spent a lot of time chasing extra/missing characters in my scripts. Besides, I got clarification on the proper way to use Window.prompt(), which is a postive outcome.
Copy link to clipboard
Copied
Hello,
Could you please update to the latest Bridge version (13.0.3) and test the "prompt" directly?
Do let us know if it resolves your issue.
Regards,
Bridge Team