Illustrator Scripting :: Using AppleScript To Place PDF As A Link At Crop Bounds Other Than Art Box?
Mar 20, 2012
trying to have an applescript place a PDF as an Illustrator Link at the PDF's Media Box using "make new placed item". The only result possible as far as I can tell is a link at the PDF's Art Box.
I've seached around and have seen others with the same issue, but no answers as to whether it is actually possible. As with most Applescript stuff, I am either way overthinking it or it is not possible directly.
Currently I have a workaround using an Applescript script controlling Acrobat to sidestep the problem by setting the Art and Crop box to Media box, then place as a link in Illustrator, but it is not a direct route into illustrator.
I have also noticed that in the "Adobe Illustrator CS5 Scripting Reference" that the "PDF options object properties" do not honor the PDF crop bounds (except for the default value of Media Box). Is this an inherent problem with Applescript/Illustrator and PDF crop boxes? Could it be that the options for Open PDF and Place PDF are crossed?
View 7 Replies
ADVERTISEMENT
Apr 3, 2012
I need to convert javascript to Apple script.
try {
app.activeDocument.layers.getByName( '.ARD' ).remove(); } catch (e) {};
View 1 Replies
View Related
May 25, 2013
How can i export only the artboard as PSD? When i use this script a lot more is exported.
with timeout of (10 * 60) seconds
tell application "Adobe Illustrator"
activate
set dpi to 90 as text
set documentnaam to name of current document
[Code] ....
View 1 Replies
View Related
Jun 30, 2013
how to get/determine the visible bounds (top+left coords and width+height or Rect structure) of a group having a clipping mask or several masks? When a script asks for Visible Bounds, Illustrator provides the coords/size of the group like it does not have any clipping mask. So, you see a circle of 10px diameter (and these are the actual visible bounds of this group), but Illustrator says that the visible bounds are 50 px wide and 70 px in height.
And what to do if the group contains multiple clipping masks of different shapes/sizes?
View 3 Replies
View Related
May 4, 2012
I want to overprint a PMS colors using Applescript. I though if I changed the property of the selected items fill color from (fill overprint:false) to (fill overprint:true) it would work. This doesn't seem to change a thing.
This is the script I am currently using:
script ChangeOverprint
tell application "Adobe Illustrator"
local docRef
[Code]....
This is the picture of a simple document I created. The elipse has fill overprint:true. The polygon has filr overprint:false. The original value for the property fill overprint was false. I changed it in the script to true. Which the log shows it changed.
View 1 Replies
View Related
Sep 20, 2012
I have a PDF file with 25 pages that I need to get into the form of an Illustrator file with 25 layers. I found the example of opening a particular page of a PDF file (using CS6), and that works. And I can create layers. But I can't figure out how to place a particular page of a PDF file into the new layer. Where/how do I provide the page info?
(I have a PostScript program that generates artwork for signs that are to be laser etched at the TechShop. The laser interface uses Illustrator and a special Print driver. I notice that opening a page from a PDF file positions the contents slightly differently than placing that page, when I do it manually, so I figured I'd create the multilayered Illustrator file by opening one page (which works) then placing all the pages in their own layers, then deleting the first page. Then the positioning will be consistent. But I'm stuck at placing a PDF page...)
tell application "Adobe Illustrator" to activate
-- This function opens the file passed as
-- a file reference parameter, at page myPage.
-- fileToOpen is a reference to a multi-page PDF file
-- and needs to be set up before calling this function.
on openMultipageFile(fileToOpen, myPage)
tell application "Adobe Illustrator"
set user interaction level to never interact
[Code].....
View 2 Replies
View Related
Mar 23, 2012
I've been looking around for a script that will take the used spot colors in a document and place them in a predetermined spot. I've came across several posts about this, such as the COLOR CHIPPER although I think it's focus was on swatches. What is confusing is the part of making New CMYKColor or RGB or if I even need to do that. I've looked at other posts and the Adobe docs, but none seem to work. Adding the text isn't difficult, it's getting these spot colors to reflect what's in the document that is. From what I'm seeing now:
I may have to use some other type of script such as Applescript to get rid of unused swatches first throught the actions panel, but I'm not sure.I could possibly use the getByName method to call out the specific rectangle and the and relative callout with the appropriate color instead of having to position everytime.
View 9 Replies
View Related
Dec 4, 2013
Is it possible to automate the rounding of font sizes if they are in decimal form? I have a few thousand files I have to prepare for upload and they can't have font sizes such as 8.214 which several do. With AppleScript would it be possible to identify and then round up or down such font sizes?
View 2 Replies
View Related
Apr 9, 2012
I´m aware that Illustrator doesn´t have multiple artboards options for JPG as it does with eps, or other formats, but is there any workaround for this? Looping current artboard and exporting them to JPG or something. Or maybe there is someway to force the "save multiple artboards:true" in JPG?
export document currentDoc to file exportFolder as JPEG with options ¬
{class:JPEG export options ¬
, quality:100 ¬
, artboard clipping:true ¬
, artboard range:1 - 2 ¬
, save multiple artboards:true}
View 3 Replies
View Related
Sep 19, 2012
So I'm cropping to a square, but I want the crop to extend off the image area because I want to replace the missing bit in photoshop. This effectively makes the image bigger than the original. the only way to achieve the same effect is to scale the image, that keeps the pixel dimensions the same but effectively reduces the size of the image.
is there a way to crop beyond the image bounds?
View 2 Replies
View Related
May 15, 2012
Carlos, you created a script i believe called AI_openMultiPagePDF.However i was wondering if you could change it just a bit and instead of opening the files, could you use the PLACE command instead?
The problem i have had is that some PDF's have embedde fonts that i dont have but if i place it, then flatten transparency>Convert Outlines i can use the PDF excatly as it was and not have it convert the fonts.
Is that an easy script change?
#target illustrator
#targetengine session
// script.name = AI_openMultiPagePDF_CS4_CS5_v1.02.jsx;
// script.description = opens a multipage PDF;
// script.required = requires CS4 or later
// script.parent = CarlosCanto // 01/07/12; v1.2-01/15/12
// script.elegant = false;
I didn't try opening a ridiculous amount of pages, I "only" open 35 pages....in about a minute and a half. Use with caution, save everything before running, script is memory intensive...
// Lion fix by John Hawkinson 01/15/12
START UI CODE, create user interface
var win = new Window ("dialog", "MTools - Open Multipage PDF");
[code]....
View 12 Replies
View Related
Feb 5, 2011
If I right click on a symbol instance, I get a menu item, "Break link to symbol." How can I do that same thing in Javascript?
1) That is, how do I use Javascript to break the link between a SymbolItem and the Symbol it represents? (i.e. without deleting the Symbol?)
2) Once the link is broken, how do I locate the Layer that was created when the link was broken? That is, once the link is broken, it is no longer a SymbolItem; it becomes a Layer instead. How do I locate that Layer?
3) How do I convert the Layer to a GroupItem?
View 5 Replies
View Related
Dec 5, 2012
I've written a script with a ScriptUI interface, which other people will be using. I'd like to include a 'help' button in the interface, which ideally would connect to a web page with more details. (The alternative is to create the 'help' window in javascript, but the web page already exists and it would be a shame not to use it.)
From what I've read, other Creative Suite programs may be able to connect to the web with javascript, but apparently not Illustrator.
View 22 Replies
View Related
Apr 15, 2013
Currently we create presentation documents InDesign. Each presentation page is a linked Illustrator file (the file contains drawings and description texts). We write the text in Illustrator instead of over it in InDesign because multiple designers/writers will work on each page. We have text that sometimes appear on multiple pages, this text has previously been copied and pasted into each Illustrator file that it needs to appear in, this is inefficient and prone to error.
Is there a way to link to a text file in Illustrator that remains updatable? I poked around here and found information relating to Variable Data – things similar to Data Merge in InDesign. This isn't the solution I'm looking for however. It seems like a plugin or script is the solution.
View 3 Replies
View Related
Jan 24, 2013
I'm trying to find a way to get the links and link statuses in Adobe Illustrator. It doesn't seem to be at all similar to InDesign DOM.
What I'd like to be able to do is check whether a file has a missing link. I have been able to trace it to a "placedItem" which is inherently a "pageItem". So is it possible to find the link status? Been going through the DOM for about a half hour now and still can't find it.
app.documents[0].placedItems[0] <--- How to get link status?
View 2 Replies
View Related
Sep 12, 2013
How to do it ?
View 4 Replies
View Related
Jan 24, 2014
I have a document with several artboards. In each artboard is a different linked image. Is there a way to add the linked filename to the bottom of each artboard?
View 10 Replies
View Related
Apr 15, 2012
This is my very first attempt at a script:
* this script will prompt the user for a file name and location and then save the current file as a .pdf with secure save options*/
var curDoc = app.activeDocument;
var destName = prompt ("Enter a Filename Daniel", "", "Save With Security");
var destFolder = Folder.selectDialog('Select which folder to save to :');
saveFileToPDF(destFolder+ '/' + destName); // not sure if i need this here ?
[Code] .......
i can do the math of (artboard width)-(text width) / 2 is start point of text but how do i find out the text width and the artboard width?
View 11 Replies
View Related
Jan 1, 2014
I recently created a script that reads the layer names of an Illustrator file, and uses the name to identify a swatch to use to pattern all elements on that specified layer. The script works well, and is a real time saver for our mapping staff, but it requires duplicate swatches to exist, where the only difference is their colour.
To improve the script I want to duplicate a swatch and modify its' colour before applying it to a specific layer. I think the only way this can be done is via the "placedItems" command. So the code I'm trying to write looks likke this:
for(var s=0; s<slib.length; s++){ // search swatch library
var pat=slib[s].name; // get swatch name
[Code]...
However I'm struggling to find the correct syntax to make this work.
View 2 Replies
View Related
Jun 1, 2012
I'm looking for a script to paste an object (paste in place) on top of all other layers in a file.
I know I can position a single object on the top layer and then turn the bottom layers on and off, but for my needs (and in this situation) I need to actually paste that object onto each layer.
View 1 Replies
View Related
Jul 11, 2012
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.
View 5 Replies
View Related
Jul 26, 2013
I have been working on a script to place a psd file onto only one visible layer (document has multiple hidden layers). This java code has worked so far:
var doc = app.activeDocument;
var onFile = File("C:/Users/Desktop/Desktop/ExportedArtboard-01.psd");
var mydoc = doc.placedItems.add();
mydoc.file = onFile;
mydoc.embed();
however this works with only the top layer visible (eye turned on in Ai). if top most layer isn't visible i get "target layer cannot be modified" error.
For instance say i have 1,2,3 layers. layer 1 (top most) and 3 (bottom most) would be hidden, layer 2 (middle layer) would be visible and then running the script would place the psd file on to layer 2.
View 3 Replies
View Related
Jan 21, 2014
I have been looking for a solution to automate a printing and ordering process. I have a design template with 2 pages both 8.5x11 in size. One page represents the front and other the back for double sided printing. I have 6 different images per sheet so in my links panel I have 12 total links, 2 of each. I was wondering if there is a script to update all the links with the same filename with other image? Currently I have to search through all the images and update each one.
I have 6 artboards dividing the 8.5x11 sheet proportionatly. Each artboard represents a different order. Is there a script to write the linked filename to the bottom corner of each artboard?
View 5 Replies
View Related
Sep 21, 2011
Is there a way with JavaScript to place an image with a calculated path and file name? I have 30+ artboards per document, each artboard named by product number. The actual file name of the master AI file is also already established (meaning every document I use this new script on will have already been saved).
Here's the scenario I'm hoping to create in the context of the documents mentioned above:
Run a script to "Place" a linked image based on the following calculated path:
["S:SAPCurrent Images in SAPStock Schools"] + [current ai filename minus the .ai extension]+[a hyphen like this "-"]+[currently selected artboard name]+[".jpg"]
This image link can be placed on a new top layer called "Images" or if necessary on the currently selected layer. Dimensions of the placed image should be a pre-determined size 8"x8".
Error if the ai document has not been saved yet.
View 11 Replies
View Related
Jul 2, 2012
In Illustrator CS5+, I'm looping through the objects in a document, exporting each of them to an image using exportArtBoardasImage(). They need to be trimmed afterwards, as they generally have a tonne of whitespace. Normally, I run an ImageMagick shell script (mogrify -trim). It'd be awesome if I could reproduce this functionality from within illustrator. I've seen people handle this by copy-and-pasting each object into a new file, sizing the artboard to that object, exporting, then closing the file. I'd rather not do this, as it's *way* too slow.
View 3 Replies
View Related
Nov 25, 2012
I'm working on a custom batch exporter, and at one point I need to set the crop box (inside an iteration of the current user-selection). Here's the relevant code:
var maxRect = getMaxRect ( objRef, overlappingItems );
alert ( maxRect.left.toString ( ) + " " + maxRect.top.toString ( ) + " " + maxRect.width.toString ( ) + " " + maxRect.height.toString ( ) );
doc.cropBox = [ maxRect.left, maxRect.top, maxRect.left + maxRect.width, maxRect.top + maxRect.height ];
alert ( "Crop box set" );
getMaxRect is a function that calculates the maximum bounding box between the current object ref and a group of overlapping items that I've already computed. The alert on the second line gives a nice set of numbers, so I'm fairly confident that the code thus far is ok. (In addition, I've inspected the crop marks subsequent to the execution of the above lines, and it looks all right.)
Here's the thing. Once doc.cropBox (doc being the active document) is set, it seems like the script execution simply halts. The crop box is actually set in the active document, but it seems to stop after setting this. I never see the second alert, and I don't see any error messages either.
View 4 Replies
View Related
Feb 19, 2009
I need to place a series of symbols in a document in Illustrator CS3... some symbols have multiple instances, some have only one... i need to be able to refer to them by name... right now, i can only seem to place them using this syntax...
make new symbol item in document 1 with properties {symbol:symbol 1 of document 1}
i'd like to use something like this...
make new symbol item in document 1 with properties {symbol:{name:"Text Tag"}
i've tried different syntax after the "symbol" property, but i can't seem to find what works, if there's anything that actually works...
View 3 Replies
View Related
Jan 14, 2014
Okay, So when you use a clipping mask there can sometimes be a lot of art that is invisible. If you "Select All" you'll get a rectangle only around what's visible. I want the bounds of that rectangle.
I tried itterating the art but I don't think that the art type is the best way to figure this one out. And if you use AIGroupSuite to test if an art group is "clipped" with GetGroupClipped, you get the bounds of the larger art that I'm trying to avoid.
I didn't see anything about bounds of a "selection" in the docs.
View 12 Replies
View Related
Mar 18, 2014
I save a document from .ai to .pdf in CS5 and it automatically goes to the size of the artwork bounds instead of the artboard or paper size.
View 7 Replies
View Related
Feb 11, 2014
Both Adobe Cloud application the applications do not constraint to the screen resoluation, meaning that the Window menu in Illustrator for example has options that are inaccessible instead of creating a scrolling menu within the constraints of the screen.
View 1 Replies
View Related
Mar 26, 2014
So, I'm linking table of contents text block to about 20 separate articles. Until about four days ago when I made edits to the the source TOC the articles would signal that an update was available. They no longer do this. And Yes the link to the text shows up in the links panel. The source file name has not changed and the location is the same.
View 1 Replies
View Related