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

relink script issue.

Explorer ,
Nov 26, 2018 Nov 26, 2018

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
1.6K
Translate
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

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?

Translate
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

yes, palate mention location is wrong.

Translate
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

where is the activeDocument saved?

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

Translate
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

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

Translate
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

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

Translate
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

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

Translate
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
LATEST

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

Translate
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