-
1. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Mylenium Apr 27, 2014 11:52 PM (in response to Leon123211)You'd need a script for this. Actions are dependent on user input for selections.
Mylenium
-
2. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Leon123211 Apr 28, 2014 6:53 AM (in response to Mylenium)Script will be fine as well. I know the command is embed(); but I am not sure how to embed all the placed files vs. just the one that's selected.
Thanks!
-
3. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
dougofakkad Apr 28, 2014 7:23 AM (in response to Leon123211)i thought this would work, but it seems to get only every other link. i don't know why and i'm not really a scripter...
for(i=0; i<app.activeDocument.placedItems.length; i++) {
app.activeDocument.placedItems[i].embed()
}
-
4. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Leon123211 Apr 28, 2014 7:46 AM (in response to dougofakkad)Worked like you said. Only every other file was embeded. I'll keep playing with the script to see if I can figure it out.
Thanks for your help!
-
5. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
CarlosCanto Apr 28, 2014 7:55 AM (in response to Leon123211)once you embed an item, the placedItems count decreases by one, and the array gets re-evaluated, item1 becomes item0, item2 becomes item1, etc.
to fix, loop backwards
for(i=app.activeDocument.placedItems.length-1; i>=0; i--) {
app.activeDocument.placedItems[i].embed()
}
-
6. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
dougofakkad Apr 28, 2014 7:56 AM (in response to CarlosCanto)ah, of course! thanks carlos
-
7. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Leon123211 Apr 28, 2014 7:58 AM (in response to CarlosCanto)Worked out great!
Thank you very much!
-
8. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Leon123211 Apr 28, 2014 8:04 AM (in response to Leon123211)One more quick question. How would I modify this code If I wanted to expand all symbols and expand appearance as well?
-
9. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
CarlosCanto Apr 28, 2014 8:25 AM (in response to Leon123211)what version do you have? not as easy, CS5 and older is not possible
-
10. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Leon123211 Apr 28, 2014 8:29 AM (in response to CarlosCanto)I am on CC
it's very easy to delete all symbols via
for(i=app.activeDocument.symbolItems.length-1; i>=0; i--) {
app.activeDocument.symbolItems[i].remove()
}
But I can't find an option to expand and expand appearnce
-
11. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
CarlosCanto Apr 28, 2014 1:17 PM (in response to Leon123211)There's no break link command in javascript, you have to delete the symbol and all instances will be released, you have to duplicate the symbol before deleting if you want to keep it.
-
12. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Leon123211 Apr 28, 2014 1:19 PM (in response to CarlosCanto)I thnk this can be done with actions but may involve manual interaction.
-
13. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
CarlosCanto Apr 28, 2014 1:36 PM (in response to Leon123211)wait, by "expand", you mean "break link to symbol", right?
-
14. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Leon123211 Apr 28, 2014 1:41 PM (in response to CarlosCanto)yes,
first: I want to "break link to symbol"
second: I want to delete all the symbols from the symbol library as well.
Both of these steps can be accomplished via an action, but as mentioned it may involve manual interaction.
-
15. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
CarlosCanto Apr 28, 2014 1:44 PM (in response to Leon123211)if what you want to do with symbols can be recorded in actions, you can use
app.doScript ('actionName', 'actionFolderSetName');
-----------
to expand appearance you can use
app.executeMenuCommand ('expandStyle');
-
16. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
CarlosCanto Apr 28, 2014 1:45 PM (in response to Leon123211)ok, deleting the symbols will automatically break the link to the instances
-
17. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Leon123211 Apr 28, 2014 1:55 PM (in response to CarlosCanto)Cool! I'll give it a shot.
Thanks for your help!
-
18. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Leon123211 Apr 28, 2014 2:09 PM (in response to CarlosCanto)Sorry to keep bugging you. As an alternative what would be the code syntex to run a "script" on the contents of an entire folder with multiple AI files?
Thanks so much!
-
19. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
CarlosCanto Apr 28, 2014 4:09 PM (in response to Leon123211)for that you have to bring up the system Open dialog, choose a folder, get all needed files then loop thru them. In the loop, add your current script and replace the activeDocument with each file (that you will open).
there should be plenty of examples in the forum, make a search for "getFiles("
-
20. Re: Is it possible to create an action to select & embed external file(s) placed in an Illustrator file?
Leon123211 Apr 28, 2014 4:52 PM (in response to CarlosCanto)got it. Thank you!



