Quantcast
Channel: Adobe Community : Discussion List - Illustrator Scripting
Viewing all articles
Browse latest Browse all 3671

Writing linked files name into AI file

$
0
0

Hello. I'm looking for a little help customizing the script below.

 

I would like the script to:

  1. Not include the file extension of the linked file in the file name
  2. Position the placed text relative to the top left hand corner of the linked file (not relative to the AI artboard)
  3. My linked file names have spaces in them. I would like the placed text to replace the "%20" with an actual space

 

//var Sel_itemPlaced = app.activeDocument.placedItems[0]; // if nothing is selected - use the first linked file item 
var sel_itemPlaced = app.activeDocument.selection[0]; // be sure that a linked item (and not an embedded) is selected 
//alert (sel_itemPlaced.file.name); 
var aTF = app.activeDocument.textFrames.add(); 
aTF.position = [50,-50]; 
aTF.contents = sel_itemPlaced.file.name;

 

Many thanks so far to pixxxel schubser who has helped me get this far. This request spawned from Linked files name.


Viewing all articles
Browse latest Browse all 3671

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>