Skip navigation
Seb_C_Bien12345
Currently Being Moderated

RasterItem .file property with broken link

Jul 11, 2012 3:09 AM

Tags: #illustrator_scripts #rasteritem

Hi,

 

I want to get the "file.displayName" property of a RasterItem from a file where links are broken.

 

the script :

 

myItem = app.activeDocument.selection[0];
myItem.file.displayName;

 

works fine if the RasterItem source file is where the link points at.

 

In my case, the link points to the local drive of another computer, so the "file" property of the RasterItem doesn't exists !!!

I don't understand why, because all the informations are in the Links pannel of illustrator.

 

 

Can anyone help me with that ?

 

Thanks

 
Replies
  • Currently Being Moderated
    Jul 11, 2012 3:30 AM   in reply to Seb_C_Bien12345

    AI is storing the data that is visible in the GUI in the file's XMP ( may be else where in file too ). Script only has access to the linked file if it exists… For embedded rasters where the original is no longer available parse the XMP string?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 11, 2012 4:33 AM   in reply to Seb_C_Bien12345

    What are you trying to do with the file do you need it?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 11, 2012 6:06 AM   in reply to Seb_C_Bien12345

    Once I embed an image in my file and chuck the link away… AI says I have a group a named raster ( no file extension ) But the parent frame is named ( with ext )…
    So…

    #target illustrator
    var doc = app.activeDocument;
    $.writeln( doc.groupItems.length ); // Returns 1
    $.writeln( doc.rasterItems[0].parent.name ); // Returns full name
    
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points