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

script no longer works in indesign 2023

Community Beginner ,
Jan 13, 2023 Jan 13, 2023

Copy link to clipboard

Copied

Hi all,

this is an essential script (from abracadabraPDF.net) which i'm using for years, until now.....

after the indesign update 2023 the script doesn't do anything anymore :-((

Would be great if someone could debug this:

 

myDoc = app.activeDocument;
 
if( myDoc.selection.length == 0 ){err("PDFoptions editor - offert par abracadabraPDF.net\r\r\rThere's no selection!\r\rIl n'y a pas de s\u00E9lection active !");}
 
if( myDoc.selection[0].constructor.name != "PDF" ){
//Teste si selection existante
try {
if (myDoc.selection[0].contentType == ContentType.graphicType){
//Teste si contenu est PDF ou non
try {
if (myDoc.selection[0].allGraphics[0].constructor.name == "PDF"){
placePDF(myDoc.selection[0].allGraphics[0]);
} else {
err("PDFoptions editor - offert par abracadabraPDF.net\r\r\rNo PDF content embedded.\r\rIl n'y a pas de PDF incorpor\u00E9.");
}
} catch (e){
err("PDFoptions editor - offert par abracadabraPDF.net\r\r\rNo PDF content embedded.\r\rIl n'y a pas de PDF incorpor\u00E9.");
}
} else {
err("PDFoptions editor - offert par abracadabraPDF.net\r\r\rSelect an imported PDF content.\r\rS\u00E9lectionnez un objet contenant un PDF import\u00E9.");
}
} catch (e){
err("PDFoptions editor - offert par abracadabraPDF.net\r\r\rSelect an imported PDF content.\r\rS\u00E9lectionnez un objet contenant un PDF import\u00E9.");
}
 
 
} else {
placePDF(myDoc.selection[0]);
}
 
exit();
 
 
function placePDF(n){
try {
 
//versions ulterieuresà CS4
myDoc.selection[0].place(n.itemLink.filePath,1, undefined);
 
} catch (e){
//err("Unknown error!");
}
}
 
 
 
function err(e){
alert(e);
exit();
}

 

TOPICS
Scripting

Views

1.9K

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 ,
Jan 13, 2023 Jan 13, 2023

Copy link to clipboard

Copied

I always put any script in a sub-folder named, for example, "Version 17.0 Scripts" (for 2022) or whatever version number relates to the year and version your script was first produced. Sometimes it works!

Mike Witherell

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 ,
Jan 13, 2023 Jan 13, 2023

Copy link to clipboard

Copied

thanks Mike,

the script is in the directory preferences/Adobe InDesign/version 18.0/nl_NL/Scripts/Scripts Panel

changing the directory has no effect unfortunately....

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 ,
Jan 13, 2023 Jan 13, 2023

Copy link to clipboard

Copied

Is it to show the place options for a PDF that’s already placed? Maybe try this:

 

 

displayOptions()

/**
* Shows a selected PDF’s place options 
* @ return value 
* 
*/
function displayOptions(){
    var sel = app.activeDocument.selection;
    if( sel.length == 0 ){
        alert("There's no selection");
        return
    }
    
    if( sel[0].constructor.name != "PDF" && sel[0].allPageItems.length > 0){
        var pi = sel[0].allPageItems
        var i = pi.length; 
        while (i--) if (pi[i].itemLink.isValid && pi[i].constructor.name == "PDF") {pi[i].parent.place(pi[i].itemLink.filePath, true)}  
    }else{
        sel[0].parent.place(sel[0].itemLink.filePath,true);
    }
}

 

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
Engaged ,
Jan 14, 2023 Jan 14, 2023

Copy link to clipboard

Copied

Dear Ton_T

 

I tried with InDesign 18.1 win, but there seemed to be no problem.
What about upgrading to 18.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
Engaged ,
Jan 13, 2023 Jan 13, 2023

Copy link to clipboard

Copied

Assuming that you're not seeing an error message, try uncommenting this line:

 

//err("Unknown error!")
 
 and make it say:
 
err (e + e.line);
 
 It won't fix anything but at least you'll know what the errror is and where it occurs. 

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 ,
Jan 17, 2023 Jan 17, 2023

Copy link to clipboard

Copied

thanks, 

"can't find the linked source"

seems approx the same error as below 

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 ,
Jan 13, 2023 Jan 13, 2023

Copy link to clipboard

Copied

the script doesn't do anything anymore

 

Hi @Ton_T , What is it supposed to do? Seems like all it’s doing is relinking the selection when it is a PDF

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 ,
Jan 17, 2023 Jan 17, 2023

Copy link to clipboard

Copied

Hi Rob,

yes it should relink and give you the choice of new/different pdf place options

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 ,
Jan 17, 2023 Jan 17, 2023

Copy link to clipboard

Copied

Did you try the code I posted?

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 ,
Jan 17, 2023 Jan 17, 2023

Copy link to clipboard

Copied

Hi Rob, yes I tried, seems to be the same error: can't find the link to the server (even though the link in InDesign is okay)

screenprint.png

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
People's Champ ,
Jan 14, 2023 Jan 14, 2023

Copy link to clipboard

Copied

You should contact the author so he may possibley fix it if needed.

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 ,
Jan 17, 2023 Jan 17, 2023

Copy link to clipboard

Copied

Hi Loic,

done that, he has done all he could do 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
Guide ,
Jan 16, 2023 Jan 16, 2023

Copy link to clipboard

Copied

Hi @Ton_T 

 

The script is a bit old but should work in general. Maybe nested try..catch cause problems in some versions (?)

 

Here is a quick rework, just in case:

 

https://gist.github.com/indiscripts/4fa2401237cefba65e6dc53336d6d8e7

 

Best,

Marc

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 ,
Jan 17, 2023 Jan 17, 2023

Copy link to clipboard

Copied

Hi Marc,

thanks, this one almost does it, only issue now is:

the link is a pdf on a different mac/server, now the script says pdf is missing....

if the link is placed on the desktop, the script seems to work fine

any solutions ?

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
Guide ,
Jan 17, 2023 Jan 17, 2023

Copy link to clipboard

Copied

@Ton_T 

 

Maybe you can just comment line 25:

// if( !(ff && File(ff).exists) ) throw "PDF File is missing. You probably should relink.";

 

Not sure how remote files should be tested. Is the place() method robust enough to address this case? I don't know.

 

Best,

Marc

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 ,
Jan 18, 2023 Jan 18, 2023

Copy link to clipboard

Copied

Hi Marc,

thanks for your help, i'm sure now, it is definitely the connection to the NAS server.

If links are placed on the desktop, all versions of the script work fine.

Any idea how to let the script find the link location ? maybe giving it a bit more time somehow ?

What do you mean with the place() method ? 

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 ,
Jan 18, 2023 Jan 18, 2023

Copy link to clipboard

Copied

LATEST

Hi @Ton_T ,  Not sure if this is the same, but I can replicate the error if I try to get the file path for a cloud library asset. Here I’ve placed an Illustrator object from my CC Libraries, that was added to the Library from Illustrator. For AI and PSD library cloud assets there is a sync’d local version, but it’s not the path listed in the Links panel:

 

Screen Shot 22.png

 

If I dig into my user Library the actual local path to the sync’d cloud asset is:

 

user ▸ ⁨Library⁩ ▸ ⁨Application Support⁩ ▸ ⁨Adobe⁩ ▸ ⁨Creative Cloud Libraries⁩ ▸ ⁨LIBS⁩ ▸ ⁨3C23718C4707F77D992016B7_AdobeID⁩ ▸ ⁨creative_cloud⁩ ▸ ⁨dcx⁩ ▸ ⁨ee378265-cd6f-4b65-aab6-e1a4e4406f47⁩ ▸ ⁨components⁩ ▸ ⁨8d0f5b6e-a36c-47a6-b9c0-d38a75b89e6a.ai

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