• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Adobe Bridge 2023 does not recognize the javescript command "prompt"

Community Beginner ,
Mar 19, 2023 Mar 19, 2023

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.

TOPICS
Scripting

Views

694

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 20, 2023 Mar 20, 2023

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. 

Votes

Translate

Translate
Community Expert ,
Mar 19, 2023 Mar 19, 2023

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).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 20, 2023 Mar 20, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 20, 2023 Mar 20, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 20, 2023 Mar 20, 2023

Copy link to clipboard

Copied

Indeed, Window.prompt() does work (capital "W")

 

gregreser_0-1679335055670.png

 

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 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 20, 2023 Mar 20, 2023

Copy link to clipboard

Copied

Yes alert() works in older versions of Bridge. This was just unsupported behavior that they must have tightened up.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 20, 2023 Mar 20, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 20, 2023 Mar 20, 2023

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");

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 20, 2023 Mar 20, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 20, 2023 Mar 20, 2023

Copy link to clipboard

Copied

No problem, we'll get this figured out.

Can you post the entire script you are testing?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 20, 2023 Mar 20, 2023

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/");
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 20, 2023 Mar 20, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 20, 2023 Mar 20, 2023

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. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 21, 2023 Mar 21, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2023 Mar 21, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

LATEST

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

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines