Illustrator Scripting :: How To Set Tabs In TextFrames With TabStops
Oct 31, 2012Javascript syntax, or script, that sets tabStops and positions them.
I can't get it working.
Javascript syntax, or script, that sets tabStops and positions them.
I can't get it working.
How to divide all textFrames in one-character-per-textFrame?
Example: the textFrame "Letters" will be divided in 7 textFrames: "L", "e", "t", "t", "e", "r", "s".
I have a script that will select text Frames, but I have come into a situation where I need to exclude any text frames that do not have a fill color. I do not see a filled Boolean property for character attributes or text Frames.
This is what I used to select all text on all visible and unlocked layers. I dont see a way to exclude textframes that have no fillcolor.
if (app.documents.length > 0 ) {
var doc = app.activeDocument;
var numTextFrames = 0;
for ( i = 0; i < doc.textFrames.length; i++ ) {
try {
textArtRange = doc.textFrames[i];
textArtRange.selected = true;
} catch (e) {} } }
I'm try to automate the importing of the Varaible and datasets into my graphs via Scripting, but the ImportVaraibles() function doesn't seem to work. Here is my Script, mostly copied from the example script provided with Illustrator (CS5). And, this works manually, using the file names in the script, via Load Variable Library
Set appRef = CreateObject(strIllistratorVersion)
'Open the file and import the datasets
Set docRef = appRef.Open(strTemplate & "200-500.ai")
'docRef.Datasets.RemoveAll
docRef.Variables("Yearbook").Delete
Here is the problem, after I delete the previous library, then this next line, right from the example, does nothing
The script then exits with 'No Datasets in this document'
docRef.ImportVariables (strXMLFolder & "Lumber_200-500.xml")
'appRef.DoJavaScript "alert('Template:" & strTemplate & strRange & ".ai | XML file:" & strXMLFolder & "" & objFile.Name & "^')"
If (appRef.Documents.Count > 0) Then
Set docRef = appRef.Documents(1)
[Code]....
If I remove that delete line, the script runs, but just uses whatever Variables I had last loaded, not the XML file.
It's simply not loading. What do I need to do to get it to load?
Can you access graph data through the scripting DOM?
View 3 Replies View Relatedissues switching layout tabs by clicking on the tabs?
Occasionally, clicking the Model or other layout tab results in no action, as if I'm not clicking on it.
All other controls (within and external to C3D) function normally so it's not a mouse hardware issue.
It will usually correct itself if I "restore down" the main application window, then maximize it again.
The -layout command is a workaround too.
the Script of creating mirror text and stroke text in Adobe illustrator scripting.
View 4 Replies View RelatedI've used illustrator a bit for drawing pictures, but never for web graphics... I need to create some tabs (for the top of a webpage). Maybe illustrator isn't the most common tool for this but it's the one I can use the most.
Anyone know of any tutorials that might be useful (i've not found any) or have any tips for making the tabs look nice (e.g. what effects to use)
I am having issues with tabs lining up for a current menu project I am working on. Im using paragraph styles and character styles as well. All prices shown have the same styles and sould justify right,but there are odd gaps.
View 2 Replies View RelatedI have a single column of copy in illustrator and at the end of each line is a page number that is tabed to that point, looks fine but when I print to PDF they come out crocked, even saved the Illustrator copy and droped it into a photoshop file, and still shows up croocked?
View 8 Replies View RelatedI'm using Illustrator CS5
When I move an object to a new tab(drag and drop), the end reult is very low resolution/distorted image?
I'm trying to change the tabs on a paragraph of text but my tab window floats. I need it to be tied to the block of text. At the moment, if I move across the page, the tab window will no longer be above the text I'm trying to edit.
View 7 Replies View RelatedQuite new to Ai's scripting stuff.
I'm having a complicate time with Ai's save to jpg options vs artboard sizes and units conversions.
Say, i have a doc (from my client), which they inherited and enhanced for 10 years may be.
It's "supposed" to be in millimeters, but artboardRect gives me those values :
-0.27880000000005
436.191388980878
646.457
-0.20900000000074
which sound like weird points or pixels.
I need to export a jpg (or gif, or png), that will be X pixels wide. For the purpose of the test i set it at 1200.
var maxLargeurPx = 1200;
First thing, getting the artboard's width :
largeurArtboard = Math.abs(thisArtboardRect[2]-thisArtboardRect[0]);
// 646.7358
Then i try to have a multiply factor to use
coefExport = /*Math.round*/ (100 * maxLargeurPx / largeurArtboard);
// 185.54717397738
and then set my ExportFile jpg to this value (i can't give it a number)
// exportOptions.horizontalScale = coefExport
That's when it's getting fun : my images are 1204 px wide with or without clipping.
Of course, i "can't" resize the doc for each export, especially expecting to have dozens of those, with different values, dimensions, etc.
I wrote the following AppleScript to open a PDF file and export is as PNG. I am using Illustrator CS5.
The export command gets an error: Adobe Illustrator got an error: Can't get current document.
when it encounters the export command.
set inputFile to (choose file with prompt "Open PDF file to convert to PNG:") as text
set exportFile to inputFile & ".png"
tell application "Adobe Illustrator"
if not frontmost then activate
open inputFile as alias without dialogs
export current document to exportFile as PNG24 ¬
with options {class:PNG24 export options ¬
, resolution:300 ¬
, matte color:{red:0, green:0, blue:0}}
close current document saving no
end tell
Im trying to add a pdf on top of an existing PDF in illustrator using a script. This is supposed to be done by anyone at my firm so that is why I want it in a script. I also have a lot of other functions that works that will do some other stuff with this document.
Created this from the scripting guide but it doesnt work. Im pretty sure its the embedDoc var thats empty and i dont understand why. Im not sure if the File "points" to the directory of the script or the original file but Ive tried both ofcoarse.
This is the masterpiece
var embedDoc = new File("/temp/testfile1.pdf");
if ( app.documents.length > 0 && embedDoc.exists ) {
var doc = app.activeDocument;
var placed = doc.groupItems.createFromFile( embedDoc );
}else {alert("suck")}
Is it possible to reference layers or groups by their names instead of their index using VBA? If so, what is the sytax? I know you can do it in Extendscript, but I'm not finding info for VBA.
View 7 Replies View RelatedSwatches Swatches Read-only. The swatches in this document.
Deletes a swatch from the current document
Set appRef = CreateObject("Illustrator.Application")
Set documentSwatches = appRef.ActiveDocument.Swatches
Set swatchToDelete = documentSwatches(5)
swatchToDelete.delete
How am I supposed to be able to make changes to the swatches collection - it is read only...
Not supprisingly I have failed to implement this in C-sharp
I am trying to close alert at once but the loop continues the alert, how can I stop the alert at once
var doc = app.activeDocument
var layersToTargetNameArray = ["Background", "Artwork", "diecut", "size", "sign off panel"];
for (var i = 0, il = doc.layers.length; i < il; i++) {
var curLayer = doc.layers[i];
[Code] ......
Is there anyway in JavaScript to replace one swatch with another?
I've seen other posts where similar questions have been asked, but the solution seems to involve iterating over all the pageItems, testing and then changing the fillColor.
All I want to do is delete/replace a specific color. Say replace Yellow with Green.
Is there a way of doing this without recursing through all of the page items?
I added CS6 COM reference in my VB.NET application and after that I have the following basic object creation in order to convert a eps file to svg. But for some reason when I create this COM object it is launching the Adobe Illustrator application. Why it is doing like this? It’s a simple COM object why it is interacting with Illustrator Editor?
View 9 Replies View RelatedI'm working on a script with an UI element. I want all values of the 2. cloumn (Rasterkeilfarbe) returned in one array and all values of the 3. column (Klischeenr.) returned in another arry.
var farben = ["black", "red", "blue", "green", "bla", "blupp"]
var myName = myInput (farben);
// rest of the script
[Code]....
Is it possible to script a tabbed ui like this, i can't seem to get it to work,
My script for now:
#target illustrator
tabbed_ui();
//Functions
function tabbed_ui(){
[Code]....
Is it possible to loop thru the artboards (with Illustrator CS5) and only work with the pageItems on the current iterated artboard?
For example, if I have 3 artboards, with 2 textFrames on each artboard. And I add the textFrames sporadically (I add a TextFrame with contents "Text 1" on artboard 1, then a textFrame with contents "Text 2" on artboard 3, then a textFrame with contents "Text 3" on artboard 1, etc).
Artboard 1:
Text 1
Text 3
Artboard 2:
Text 4
Text 6
Artboard 3:
Text 5
Text 2
Is there a way to loop thru these artboards and get the textFrames tied to the appropariate artboard? So, on the first iteration of the loop, I'm looking at artboard 1 and only looking at "Text 1" and "Text 3", then on the the 2nd iteration I'd be working with artboard 2 and it's textFrames "Text 4" and "Text 6", and so on.
If I loop thru only the doc.textFrames, the order would be incorrect, with the way I added each textFrame. Instead of artboard order, they'd be in this order:
Text 1
Text 2
Text 3
Text 4
Text 5
Text 6
What if for some reason a person wants to actually make an XML file and stick some <![CDATA[]]> in it? I looked through some manuals & OMV fairly quickly to discover no methods for that. Was wondering if there was some technique.And, just as pointed out in the indesign forums, a string of "]]>" makes the script hang up and debugging have to be stopped with the final message "Cannot execute".
View 9 Replies View Relatedis there a way to pin certain scripts to the menu in Illustrator (File > Scripts)?
It's quite a work to access to scripts by "File > Scripts > Other script" every time, so I figure there must be some easier way out there.
We have over 50 artboards in most of our documents. Is there a way to sort the artboards as listed in the artboards panel by name via script?
View 13 Replies View RelatedHow do I terminate the script - not Adobe application(s)?
exit(), quit()... - they don't work.
The only workaround I can think of is a main() function with "returns" in appropriate places, but I am just curious if there is a terminating command.
I want to make a tab in a radiotext and it does not work when i just add a tab.
I can add a space and other characters using unicode but i cant make it work with the tab character!
staticText = Grp1.add("statictext",undefined,"What? "); // Does not work
staticText2 = Grp1.add("statictext",undefined,"What?u00A0"); // Works but this is a space character
staticText3 = Grp1.add("statictext",undefined,"What?u0009"); // Does not work with Tab character
I'm needing to loop through each character of a text frame and check the color of each character. Is it possible to get the swatch name of each character? Or can you only get the red, green, blue values?
I've been experimenting with:
app.activeDocument.textFrames[0].characters[3].characterAttributes.fil lColor.typename;
// Returns SpotColor
But I can't figure out how to get the swatch name of the character this way?
How to export TIFF from Illustrator using Javascript. I could not find TIFF export type in Illustartor export type.
View 4 Replies View Relatedi can´t get any Batch script to run.For example a PDF making Batch with a folder selection.I always get the alert, no matching files found.I use cs 5 on a g 5 with osx 10.8.2..why does no file fit in the "mask" ?
Adobe permits you to use, modify, and distribute this file in accordance with the terms of the Adobe license agreement accompanying it. If you have received this file from a source other than Adobe, then your use, modification,or distribution of it requires the prior written permission of Adobe.
Export to PDFs.jsx
DESCRIPTION
This sample gets files specified by the user from the selected folder and batch processes them and saves them as PDFs.Edits by Patrick Mineault:
- only .ai files processed
- files saved in same folder as the input files
- export files have name (oldname)_export.pdf
- PDF settings: non-editable / acrobatLayers=false
for maximum compatibility with Preview
// Main Code [Execution of script begins here]
// uncomment to suppress Illustrator warning dialogs
// app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, pdfSaveOpts;
// Select the source folder.
sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator .ai files you want to convert to PDF');
[code...