Illustrator Scripting :: How To Add Buttons In Script Which On Click Run Different Codes
Nov 3, 2013
If we run script then it should display 6 button along with ok, cancel button. If we click on button1 then the coding assciated with button1 should execute and so on.
button1
button2
button3
button4
button5
button6
Ok Cancel.
View 4 Replies
ADVERTISEMENT
Feb 8, 2013
I am writing a script for Illustrator. I created a palette with some buttons. I like to keep the palette open while working in Illustrator. The problem is, that the buttons don't work. For example, I have a delete button that should delete my active selection. When I change the Window Type from palette to dialog everything works correctly.
var w = new Window ("palette");
w.orientation = "row";
w.text = "Path Transform";
var f = File ("/C/icons/corner-tr.png");
var corner_tr = w.add ("iconbutton", undefined, f );
var corner_tl = w.add ("iconbutton", undefined, f );
var corner_br = w.add ("iconbutton", undefined, f );
var corner_bl = w.add ("iconbutton", undefined, f );
corner_tr.onClick = function () {
selectedObject[0].remove();
createLines();
}
View 1 Replies
View Related
Apr 24, 2013
I want to create a dialog consisting of multiple buttons. As a result I want value which button was pressed by user.
The script (shortened to problematic part):
// I'm looping through elements on layer 'warstwa' from kolorStart to kolorStop, 'k' is used for number buttons
for (i = kolorStart, k = 0; i <= kolorStop; k++, i++) {
myButton[k] = myButtonGroup.add ("button", undefined, warstwa.pageItems[i].contents);
myButton[k].label = warstwa.pageItems[i].contents;
myButton[k].onClick = function () { wybranyKolor = myButton[k].label; myWindow.close(); }
}
The result:
But buttons don't work, wybranyKolor returning 'undefined'. If I change "wybranyKolor = myButton[k].label" to "wybranyKolor = myButton[k-1].label" I get proper answer but it is the same for all buttons so it looks that all buttons have the same action assigned. How to get each button to has unique name which can be passed to variable?
Probably I can achieve the same with radio buttons' list but with buttons it is one click less for the user.
View 7 Replies
View Related
Feb 15, 2013
I have two menus that I use often and I would like to add them to my mouse buttons. Attached is a picture of the two menus I like and the two buttons. The Shift + Click has the correct menu already (Osnap menu2) my problem is adding my custom menu to the CTRL + Click doesn't work. I labeled Osnap Menu 1 and 2, 1 being the custom menu I have use in the past and 2 being the default osnap menu that comes with the cui file. How to get the second button to read my menu rather than both read the same osnap 2 menu?
View 1 Replies
View Related
Mar 5, 2010
Often times when designing a logo I create different versions and variable options on layers. This can result in several layers in one Illustrator file. Is there an easy way or an existing script that will allow me to (with one click) create a multi-page PDF consisting of all the layers within my .ai file? The current method is turning on each layer, performing a save-as (PDF), then turning off said layer and turning on the next layer and repeating the task and so-on-and-so-forth, etc … It becomes tedious and quite often I save over the previous version, forgetting to re-name it or forget to perform a save on a certain layer. I have never written my own script before but am not opposed to trying, where do I begin?
View 12 Replies
View Related
Sep 10, 2012
I am using a MAC OS version 10.6.8 and ESTK 3.6. When I open ESTK the font is very small and I want to make it larger. I go to ExtendScript ToolKit>Preferences when I click Fonts and Colors the program crashes and sends an error report to Apple.
I would like to script Illustrator with .jsx instead of AppleScript because I am more familiar with JavaScript (plus it's cross platform compatible).
View 4 Replies
View Related
Apr 30, 2013
In Edge, I have created an application where a user can click buttons and then it takes them to a separate scene. However, I seem to have run into a problem where the click only works in a certain area of the box. I created the buttons in Photoshop and imported them to Edge. Only the edge of the button closest to the edge of the stage will work for clicking for some odd reason.
View 7 Replies
View Related
Jan 4, 2012
Illustrator CS4
I'm not exactly sure what happened, but suddenly my Type Tool can not select type by double clicking or click and drag any more.
I'm using Illustrator CS4 (14.0.0) on a MacPro with OSX 10.6.8.
View 8 Replies
View Related
Jul 6, 2013
So image a picture of a red apple with a yellow background. How do I make adobe print out he colour codes of the yellow and red within the image? I know I can manually use the eyedropper tool and then find the colour codes and then manually type it in. However, I was wondering if I can get Adobe to automatically place this code on the image itself. Do I need a special customized plug-in for this?
View 5 Replies
View Related
Dec 18, 2012
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?
View 8 Replies
View Related
May 6, 2012
Can you access graph data through the scripting DOM?
View 3 Replies
View Related
Mar 16, 2013
the Script of creating mirror text and stroke text in Adobe illustrator scripting.
View 4 Replies
View Related
Apr 10, 2013
I can't right click objects on the artboard in Illustrator CS6. For example if I want to break the link to an object I can't. I use a Wacom tablet and suspected that there is a problem with the pen. But the same thing happens if I use the trackpad on my MacBook.
View 4 Replies
View Related
May 26, 2012
In Illustrator i can not right click on any of the icons on the left, like the rectangle shape to change it. I have downloaded it and reinstalled it to limt it that out. I am not sure. Is there a setting or something?
View 1 Replies
View Related
Jan 30, 2014
Every time I open illustrator and click on the pen icon, open a document, etc etc it crashes. I am using a Mac computer OS X version 10.9. I only have downloaded fonts from dafont.com on this computer. Nothing else has been installed or downloaded. I have tried opening the program while holding CMD/OPT/SHIFT,uninstalling illustrator and redownloading but it still does not work. Below is the error message I get:
Process: Adobe Illustrator [34729]
Path: /Applications/Adobe Illustrator CS6/Adobe Illustrator.app/Contents/MacOS/Adobe Illustrator
[Code]....
View 1 Replies
View Related
Sep 9, 2012
I need a way to programmatically click one of the interface buttons, if at all possible. I've tried calling the method directly linked to the button, but for some reason it doesn't work. I've tested several different scenarios, but it never works as expected. So, I figured the easiest, most effective way would be to activate a button as if a user had clicked it.
Is there any way to do this? My button is of course an IADMItem and I've tried stuff like SendNotify(), but it just doesn't work as expected.
Seems like there's something really simple that I've been overlooking.
I'm actually a server admin/web developer who inherited a complex C++ project, so I'm still in the middle of figuring half of this stuff out.
View 1 Replies
View Related
Sep 7, 2012
In my illustration I have like 300 objects and 100 of them are gradient objects. The gradient colors all different. How to select all gradient objects in one click? Is there any plug in ore some trick?
View 6 Replies
View Related
Oct 3, 2013
I just started using illustrator CC and realize that when I clcik Transform tool button, the program crashes. It shappens even if no document is open.
I am using a mac with OS 10.7.
View 3 Replies
View Related
Jan 9, 2014
I try to double click on a file to open in illustrator, which is already open and running in the background and I get this message. Can't open the illustration. There is not enough room for the window. Increase document area and try again. The window was full screen, but after clicking off this error message it is tiny. I am using CS6 and have been for about a year and this has just started happening.
View 6 Replies
View Related
Aug 14, 2013
A context menu in the Artboard Panel would be much faster and more natural, right?
Is there a reason this is missing?
View 2 Replies
View Related
Oct 15, 2013
How can you keep the subgroups from opening when you click on a layer?
View 2 Replies
View Related
Oct 28, 2013
I've had to reinstall CS5 after a new Windows installation. Never had a problem with it before, but now I have the issue where if I click on a tool that has sub-tools, it now expands to show them. Before, to access them, I had to click and hold for them to appear. Now with them expanding on the first click, it's interrupting my work flow.
Additional issues have arisen while I'm here, such as, when doing web work, I'll change the rectangular marquee to single pixel horizontal (e.g.), make the selection, do what I want with it, then press M to adjust another single pixel line, but it'll return to the full rectangular marquee, like it resets.
I'm running a test at the moment with Open GL disabled, to test drivers or display issues, but it's doing the same thing.
My System:
Windows 7 Ultimate 64
AMD Phenom 2 X2 550 3.1GHz
4GB RAM
AMD Radeon HD7800.
View 6 Replies
View Related
Apr 17, 2012
I have noticed that when I click on any button on the Ribbon Panels it now requires more that one click to activate the button.
View 9 Replies
View Related
Jul 18, 2013
Since we updated to CC, I have a very good chance of this not working evey time I try it. Maybe 10% of the time, it will select the word/line as it should. My prefs are identical for this feature as they have for the past several version of InDesign. My partner also has trouble with copy/paste in InDesign and Illustrator as well.
View 20 Replies
View Related
Jan 15, 2014
Quite 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.
View 5 Replies
View Related
Jul 27, 2012
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
View 5 Replies
View Related
Jun 20, 2012
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")}
View 4 Replies
View Related
Apr 7, 2012
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 Related
Apr 16, 2012
Just reinstalled Photoshop CS5 after needing to reinstall Windows 7. Now instead of being to just grab the tool I want, it produces the flyout each time and I have to re-choose what I want to use. This is rather annoying and time consuming, if I am using the same tool.
Can it be coming from Windows or just Photoshop. I did try resetting the preferences and nothing changed.
View 4 Replies
View Related
Apr 16, 2013
I need some of my objects to always rotate around the same point. How can I select a point which will stay that way? Using the rotate tool resets after deselecting.
Also, I'd like to rotate objects around a certain point even when using the right click > Transform > Rotate.
View 5 Replies
View Related
Aug 9, 2012
ive just got illustrator and it crashes everytime i click it?
View 3 Replies
View Related