Created
August 8, 2013 11:39
-
-
Save milligramme/6183891 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create anchored object without cut&paste | |
// create a hidden doc | |
var doc = app.documents.add(false); | |
var tf = doc.textFrames.add({geometricBounds:[0,0,105,200]}); | |
var rect = doc.rectangles.add({geometricBounds:[40,40,60,80], fillColor:"Magenta"}); | |
// create a library | |
var lib_file = new File("~/Desktop/tmp.indl"); | |
var libr; | |
try { | |
libr = app.libraries.add(lib_file); | |
} | |
catch(e){ | |
libr = app.libraries.item(lib_file.name); | |
} | |
// store the item as first asset | |
libr.store(rect); | |
// place! | |
libr.assets.firstItem().placeAsset(tf.insertionPoints[0]); | |
// remove | |
rect.remove(); | |
libr.close(); | |
lib_file.remove(); | |
// confirm it | |
doc.windows.add(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment