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

relink script issue.

Explorer ,
Nov 26, 2018 Nov 26, 2018

Copy link to clipboard

Copied

Hello, everyone.

I am writing the script for relinking on illustrator file. It is perfectly working on illustrator CC2014. but I got the issue on illustrator CC2017 and illustrator CC2018.

Note: I am mentioned manual link location and Script linked locations differ on link palate location. snapshot for your reference.

kindly advice how to mention the folder location in the script.

Issue reference:

Screen Shot 2018-11-26 at 9.31.00 PM.png

Folder structure reference:

Screen Shot 2018-11-26 at 9.41.54 PM.png

Script reference:

#target illustrator-21 

 

function linkReplacer() { 

     var orginalUIL = app.userInteractionLevel; 

     app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS; 

     if (app.documents.length == 0) { 

          alert('Please have an "Illustrator" document open before running this script.'); 

          return; 

     } else { 

          docRef = app.activeDocument; 

     } 

        

     var defaultFolder = new Folder (Folder(app.activeDocument.path + '/../040 Images/043 High Res')); 

     var psdFolder = defaultFolder; 

     if (psdFolder == null) return; 

      

     with (docRef) { 

          var placedFiles = new Array(); 

          for (var i = 0; i < placedItems.length; i++) { 

               placedFiles.push(placedItems.file.name); 

          } 

           

          for (var j = 0; j < placedItems.length; j++) { 

               var rePlace = new File(psdFolder.fsName + '/' + placedFiles); 

               if (rePlace.exists) { 

                    placedItems.file = rePlace; 

               } else { 

                    alert('File "' + placedFiles + '" is missing?'); 

               } 

          } 

     } 

     app.userInteractionLevel = orginalUIL; 

 

linkReplacer();

TOPICS
Scripting

Views

1.2K

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
Explorer ,
Nov 26, 2018 Nov 26, 2018

Copy link to clipboard

Copied

I am trying to follow your post...I am a little confused as to what you are asking. So it is putting in the wrong file location?

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
Explorer ,
Nov 26, 2018 Nov 26, 2018

Copy link to clipboard

Copied

yes, palate mention location is wrong.

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 ,
Nov 26, 2018 Nov 26, 2018

Copy link to clipboard

Copied

where is the activeDocument saved?

var defaultFolder = new Folder (Folder(app.activeDocument.path + '/../040 Images/043 High Res'));

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
Explorer ,
Nov 27, 2018 Nov 27, 2018

Copy link to clipboard

Copied

Hi CarlosCanto,

Active Document saved location for your reference (smb://indae01/ExampleJobContainer/00_Kalai_Test/030 Assembly/activeDocument.ai).

Screen Shot 2018-11-27 at 6.48.12 PM.png

Thanks in Advance.

Kalaimani Sathiyanathan

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 ,
Nov 27, 2018 Nov 27, 2018

Copy link to clipboard

Copied

your script worked fine here under Windows 10, CC2019. It didn't add the unwanted folders.

do this folder actually exist? or is it just wrongly reported in the UI?

00_Kalai_Test/030 Assembly/00_Kalai_Test/040 Images/043 High Res

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
Explorer ,
Nov 27, 2018 Nov 27, 2018

Copy link to clipboard

Copied

this script worked fine here under iMac (OS: macOS High Sierra, CC2017 to CC2019.

it is wrongly reported in the UI.

Screen Shot 2018-11-27 at 11.20.19 PM.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
Community Expert ,
Nov 27, 2018 Nov 27, 2018

Copy link to clipboard

Copied

LATEST

oh ok, then it is not impeding your work, still annoying but at least you can carry on.

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