Hello everyone!
I need a script to add words in my keywords. It's possible?
I'm trying this:
activeDocument.XMPString ("ok Script");
ActiveDocument.Save (); // dont work
Thank cooperation!
I need a script to add words in my keywords. It's possible?
I'm trying this:
activeDocument.XMPString ("ok Script");
ActiveDocument.Save (); // dont work
Thank cooperation!
I have about 74 layers in illustrator and i want to run a script to select combination of layers at a time.
For e.g. I want 5 layers to be selected and save them as one .jpg. Then say i need to select other 3 layers to save it as a seperate .jpg file. If i do it manually it comes upto 300,000 images.
I can create a csv file with all layers to be selected presented in a row. I need help with the command to select 4 or more layers at a time, say if i have layer1, layer2, layer3, layer4 then a command to select those 4 layers and save them as a .jpg file.
Any help will be greatly appreciated.
Thanks
H Patel
CEO
Hi,
I found this script to write XMP metadata to an open file, but it does not seem to work for me in Illustrator CC. The error message is "XMP exception: Source and destination XMP must differ".
Is there perhaps an alternative method of writing properties to the XMP fields?
Thanks,
Rich
if( xmpLib == undefined ) {
var xmpLib = new ExternalObject("lib:../../Frameworks/AdobeXMPScript");
app.synchronousMode = true;
}
var docXmp = new XMPMeta(app.activeDocument.XMPString);
var myXmp = docXmp;
myXmp.setProperty(XMPConst.NS_XMP, "CreatorTool", "My Script");
XMPUtils.appendProperties(myXmp, docXmp, XMPConst.APPEND_ALL_PROPERTIES);
var myDocFile = new File(app.activeDocument.fullName);
var docRef = new XMPFile(myDocFile.fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
if (docRef.canPutXMP(docXmp)) { docRef.putXMP(docXmp); }
docRef.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
How to sort objects alphabetically (inside of a layer) on layer list?
I have already tried scripts for Layer sorting. They work indeed for the layers, but not the objects themselves packed inside.
(Sorry if this is too basic a question, I'm not much of a scripter.)
I'm looking for a way to show the previous/next layer (or rather, sublayer) with a quick shortcut. I have a document with many layers in which I have to constantly go through layers and it would be a timesaver. To be more precise, given this sample structure
Layer A
|_Layer A1
|_Layer A2
|_Layer A3
|_Layer A4
|_Layer A5
LayerB
|_Layer B1
|_Layer B2
|_Layer B3
|_Layer B4
|_Layer B5
And I want to , if I'm in A1, with a command hide A1 and show A2, or if I'm in A4 hide it and show A3.
Can someone hlp me to figure out how to achieve this or if there'a anything already made?
Help would be very much appreciated.
I have a script that I use in AI 7 to do an action I REALLY need for my work. Illustrator got rid of that particular feature in 7 so I need a script for it. Will the same .jsx file still work if I install it in CC? I'm hoping to upgrade this year but need to know if this is possible first.
Thanks.
Hi,
(Illustrator CC 2014 on Windows 7)
I had hotkeys defined using AutoHotkey to execute a script in illustrator by executing a commandline, and with the script as an argument. This used to work fine, but it has suddenly stopped working for me, maybe with one of the latest Illustrator CC updates...
The command-line looks something like:
"C:\Program\Adobe\Adobe Illustrator CC 2014\Support Files\Contents\Windows\Illustrator.exe" "c:\pathtoscript\myscript.jsx"
Now Illustrator just sits there and nothing happens!
Has anyone else seen this? Can someone confirm if this worked in previous versions and also confirm that it doesn't in the latest, please?
Thanks!
Hi,
I'm looking for a script/program that if you run it, all the .eps
files in a folder will batch convert to a png-24
with 250% scale.
Erdem
As I understand it, TextFonts is a collection of all fonts available to Illustraot. Is there a collection of all fonts used in the open document? Or would I have to step through every textFrame an create that list myself?
Does anyone know how one would go about ungrouping all groups on an active layer with JavaScript?
I'm having difficulty writing a script that deletes all of the symbols in the document (as opposed to just breaking links or expanding which I apparently cannot do).
app.sourceDocument.symbols.removeAll();
When it reaches a symbol that's used in the document somewhere it spits out this error:
Error 1200: an Illustrator error occurred: 1346458189 ('MRAP')
Hello,
I have a question about dialog box.
I have a rectangle in artboard with dimensions 50x50mm.
When I press button "Pobierz" I would like get object width in text box.
There is any way to do this?
This is my initial script.
var myWindow = new Window ("dialog", "Dane do impozycji");
myWindow.orientation = "column";
//myWindow.alignChildren = ['', 'center'];
myWindow.panel1 = myWindow.add('panel', undefined, '');
myWindow.panel1.orientation = 'column';
myWindow.przyciskOK = myWindow.add('button', undefined, 'Wykonaj', {name:'ok'});
myWindow.przyciskOK.orientation = 'row';
myWindow.panel1.add ("statictext", undefined, "Szerokość etykiety:");
var myText = myWindow.panel1.add ('edittext {text: 0, justify: "center"}');
myText.characters = 5;
myText.active = true
myText.alignment = ["centre","centre"];
var pobranie = myWindow.add('button',undefined,'Pobierz');
pobranie.onClick = function() {
//THERE SHOULD BE SOME FUNCTION TO GET VALUE IN TEXT
}
myWindow.show ();
How to check the raster image resolution in illustrator through script?
I solved my original query, and have removed the original defective script from this post. The script below takes any set of selected objects and rearranges their stacking order so that the (vertically) topmost object is at the back of the stack, the vertically lowest at the front (and similarly for all intervening objects).
It should now replicate the action of JET_StackTopToBottom.jsx, which is apparently no longer available. I hope this may help anyone who, like me, would gladly have paid to find it!
David Entwistle
var thisDoc = activeDocument;
// get selected objects
var selObj = thisDoc.selection;
// count the selected objects
var selObjCount = selObj.length;
// sort selected objects by their height from the page origin
var byProperty = function(prop) {
return function(a,b) {
if (typeof a[prop] == "number") {
return (a[prop] - b[prop]);
} else {
return ((a[prop] < b[prop]) ? -1 : ((a[prop] > b[prop]) ? 1 : 0));
}
};
};
var symbolsSorted = selObj.sort(byProperty("top"));
// for each object in turn in the ordered selection, BringToFront
for(i = selObjCount; i >0; i--){
var currObj = symbolsSorted[i-1];
currObj.zOrder(ZOrderMethod.BRINGTOFRONT);
}
redraw();
I´m passing by a strange script behaviour. I´m trying to refine a script to export artboards as TIFF.
So suppose I started "var op = new ExportOptionsTIFF()"
And I set op.resolution = 250
Now I try to run this script via Extended Script Toolkit. I press play and it goes right...But If I make more tests I have this problem:
If I set a differnt resolution (for example, 365) the Script will ignore this new and will use the only value 250 defined in the past (in my first test). If, for a third time, I set another new value, the Extended Script will ignore this value and use the 365 I set in a previous test.
Look´s it´s recording the differnt values I put but it is always delayed one or two times :/
Do not know if I was able to better explain the problem.
Have you already passed by it?? Should I consider this as a problem? Or it´s only an Extendes Script software mistake?
Thank you a lot
Gustavo.
Hello everyone!
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? Thank you!
Ok.. I'm sure this has been posted before (already searched, didn't find however), but does a file packaging script exist for AI? (one that collects all linked images and fonts and places them in one place) This would be IMMENSELY helpful to me if anyone can post a link to one or even be willing to write it.
OS: W7
AI Version: CS5
Thanks in advance!
Hi
When I try to create a new document from an HTML extension by calling a jsx script the script freezes until Illustrator is put into focus (for example by clicking it)
Only after focus returns to Illustrator will the script continue, in the meantime the Illustrator icon will jump around like a nutter.
I have not tired this out on windows only mac.
To get around this I get main.js to exec 3 oascript comands
1) to create the document: oascript -e 'tell application "Adobe Illustrator" to make new document'
2) focus on Illustrator: oascript -e 'activate application "Adobe Illustrator"'
3) run the jsx: oascript 'do javascript "path/to/my/script.jsx"'
This works but there are some obvious drawbacks.
Has anyone managed to create via an extension a new document and have the script work on it without the need for focusing on Illustrator without the use of oascript?
If so how?
Interestingly enough, if one runs from the applescript editor
tell application "Adobe Illustrator" to make new document
it will work fine. but if one runs from terminal
oascript -e 'tell application "Adobe Illustrator" to make new document'
it freezes Illustrator and causes the Icon to jump like a nutter until refocus.
Regards
Trevor
Bridgetalk is an annoyance. I hate the hoop jumping that one has to do to get dialogs and palette windows to interact with Illustrator.
With that said, from my tests, it seems like all that one really needs when "cycling" a script is.... the active document.
In most of my scripts, it seems, if I get the active doc object then I can keep my script working on the document in question.
I was playing with this code:
#target illustrator #targetengine main doc = function() { var bt; bt = new BridgeTalk(); bt.target = 'illustrator'; bt.body = 'foo()'; bt.onResult = function(x) { $.writeln('result', x.body); // result[Document test.ai] // somehow return active document from onResult }; bt.send(); }; function foo() { return app.activeDocument; } var activedoc = doc(); // do something with activedoc ... // and later, like in a palette window button onclick: activedoc = doc(); // keep workng on activedoc...
This is hard for me to explain (as I write this message in frustration), but I'm trying to think of a way to make the BT stuff simpler than what I have done (and seen) in other code.
Basically, it seems like all one needs is the activedoc. If I have the active doc then my code can keep working on things.
The problem is, BT returns a string and not an object.
Long story short, is there any way for me to convert the active document string back into a usable object?
Maybe I could parse the string to get "test.ai", then use a bit more code to grab the "activedocument" object from the name of the file?
Are any of my questions making any sense to anyone?
Thanks!
M
Did I mention that I dislike bridgetalk? It just makes scripting so messy .... Feels hacky to me.