Can I execute a menu command in illustrator CS5 using extendscript

I've seen it in Indesign but can't seem to get it to work in illustrator. If not could anyone tell me how I would group all items together on a layer run a function then ungroup them again. I'm fairlt new to this and struggle with the documentation
Thanks
Bob

Hi Bob,
It's been a bit more difficult.
(And there are already some handful Illustrator Scipters all over the world.)
For the beginning you can try something like this:
// https://forums.adobe.com/thread/1535178
// MoveSimpleArtwork2NewGroup.jsx
// regards pixxxelschubser
var aDoc = app.activeDocument;
aDoc.selectObjectsOnActiveArtboard();
var sel = aDoc.selection;
var newGroup = aDoc.groupItems.add();
for (i=sel.length-1; i>=0; i--) {
    sel[i].moveToEnd(newGroup);
alert("done");
Have fun

Similar Messages

  • Can I execute MySql's command from java application?

    Can I execute MySql's command from java application? And how?
    For example :
    load data local infile 'D:\\myData.txt'
    into table myTable
    fields terminated by ';'
    lines terminated by '\n';

    1. get the jdbc driver for mysql from the mysql site at: http://dev.mysql.com/downloads/connector/j/5.0.html
    2. follow the installation instructiions... which you'll also find in your mysql manual...
    Happy travels. Keith.

  • How can I get a serial number for Illustrator CS5?

    How can I get a serial number for Illustrator CS5 when I have a complete CC subscription?
    I have a GCC Expert 24 plotter running on OS X and the direct cut plugin is only compatible with CS5 or earlier.
    I have tried asking in support chat but it never actually works, my next option is to ring or get a cracked version but i'm trying to avoid both of those options if I can.
    Thanks.

    xdmg,
    In addition to what Lutz said, unless you buy a CS5 that is still new and unused, you will need a licence transfer through Adobe,
    http://helpx.adobe.com/x-productkb/policy-pricing/transfer-product-license.html
    and the application must be deactivated on any machine it has been installed on.

  • Trying to print separation to pdf in Adobe Illustrator CS5 using Mac OS 10.6.7

    Is it possible to print separations to pdf in Adobe Illustrator CS5 using Mac OS 10.6.7. Can't seem to make it work. Help.

    You should be able to input any size you want into both fields. If not reinstall acrobat or manually assign a correct PPD. System Preferences >>Print & Fax >> Adobe PDF >> Options >> Driver

  • How can we add a menu in Adobe Illustrator CS3?

    Hi
    I want to create a new menu in Adobe Illustrator menu structure, and I want to call another application through that menu. After hours of searching in web I came to know that  I have to work with Plugin programming. So I downloaded the adobe illustrator SDK CS3 and started the programming using Visual Studio .NET 2005 with the sample codes provided with the SDK. And I am still  not able to find out the any solution for adding a new menu. The problem is the the documentation provided with the sample code is too short, I am not able to understand the control flow , the functions used in the sample code.
    please help me!
    Sreejesh K V

    Hi,
    Thank you very much for your help
    I am not clear about the following code.
    extern AIErr addMenu( SPInterfaceMessage *message ) {
         AIErr error = kNoErr;
         // Add a menu item to the About SDK Plug-ins menu group.
         SDKAboutPluginsHelper aboutPluginsHelper;
         aboutPluginsHelper.AddAboutPluginsMenuItem(message,
                        kSDKDefAboutSDKCompanyPluginsGroupName,
                        ai::UnicodeString(kSDKDefAboutSDKCompanyPluginsGroupNameString),
                        "Adobe Plugin...",
                        &g->aboutPluginMenu);
         // Add other menus.
         AIMenuItemHandle          throwAwayAIMenu;
         AIPlatformAddMenuItemData throwAwayMenuData;
         AIMenuGroup                    throwAwayMenuGroup;
         char strBuffer[255];
         #define kMenuPlayMenuGroup     "Menu Play Group"
         #define kSDKMenuGroup     "SDK Group"
         // First we create a normal plug-in menu to use a hierarchical root                                   
         throwAwayMenuData.groupName = "Window Utilities";
         error = sADMBasic->GetIndexString(message->d.self, kMenuStringResID, 1, strBuffer, sizeof(strBuffer));
         if (error)
              goto error;
         throwAwayMenuData.itemText = SUctopstr ( strBuffer );
         error = sMenu->AddMenuItem( message->d.self, kSDKMenuGroup, &throwAwayMenuData,
                                            0, &throwAwayAIMenu );
         if ( error )
              goto error;
         // Now we declare the menu item a menu group
         sMenu->AddMenuGroupAsSubMenu( kSDKMenuGroup, 0, throwAwayAIMenu, &throwAwayMenuGroup );
         // Now we can add menu items to it.
         throwAwayMenuData.groupName = kSDKMenuGroup;
         *strBuffer = '\0';
         error = sADMBasic->GetIndexString(message->d.self, kMenuStringResID, 8, strBuffer, sizeof(strBuffer));
         if (error)
              goto error;
         throwAwayMenuData.itemText = SUctopstr ( strBuffer );     
         error = sMenu->AddMenuItem( message->d.self, "Auto Update 1", &throwAwayMenuData, 0,
                                            &throwAwayAIMenu );
         if ( error )
              goto error;          
         // enabled for paths and no masks in the selection
         error = sMenu->UpdateMenuItemAutomatically( throwAwayAIMenu, kAutoEnableMenuItemAction,
                        kIfPath | kIfGuide, kIfMask,
                        0, 0,
                        0, 0 );      // don't care about other update options
         if ( error )
              goto error;     
         sMenu->AddMenuGroupAsSubMenu( kMenuPlayMenuGroup, 0, throwAwayAIMenu, &throwAwayMenuGroup );
         throwAwayMenuData.groupName = kMenuPlayMenuGroup;
         *strBuffer = '\0';
         error = sADMBasic->GetIndexString(message->d.self, kMenuStringResID, 2, strBuffer, sizeof(strBuffer));
         if (error)
              goto error;
         throwAwayMenuData.itemText = SUctopstr ( strBuffer );     
         error = sMenu->AddMenuItem( message->d.self, "Menu Play", &throwAwayMenuData, 0,
                                            &throwAwayAIMenu );
         if ( error )
              goto error;          
         error = sMenu->UpdateMenuItemAutomatically( throwAwayAIMenu, kAutoEnableMenuItemAction,
                        0, 0,      // don't care about what's in artwork
                        kIfGroup, // is selected and
                        kIfTextPath,      // are not selected
                        0, 0 );      // don't care about other update options
         if ( error )
              goto error;     
         Can you give me the sample code to call the functions within the SDK API.
    For example adding an url in the plugin menu, calling another application ( .exe).
    I just tried to do myself but it ended in syntax error because I am not familiar
    With the VC++ programming.
    Thanks
    Sreejesh k v

  • Executing a menu command from a script

    Hi,
    I'm still not very familiar with the PS CS4 object model and I'm wondering whether I can trigger the execution of a menu command from a script.
    My purpose is to fix the CS4 issue with some plugins that have a bug causing some elements of the PS CS4 interface (like the Arrange Documents drop down menu) to appear blank when hovered with the mouse. This problem usually disappears when launching these plugins. For example, you'll have the problem when installing Nik Software's Silver Efex (they promised to fix this in February but we're still waiting). Launching "File | Automate | Nik Selective Tool" and then closing the dialog fixes the issue... until you re-launch PS.
    So I want to do that automatically when PS starts. I tried with an action which I attached to the startup event but the action is not launched (probably because the plugin is not active yet). So I tried the scripting way but I don't see how I can launch a menu command automatically.
    Thanks in advance.
    Patrick

    Most events that I have used run the script after the event but I'm not sure about the startup event order either.
    You might try add the creation of a new doc to your action. Then after the nik step close the doc without saving. That may force Photoshop to wait until the plugin loads before running the action.
    Another thing you could try is create an script that calls your action. Something like
    doAction( 'run Nik', 'startup actions' );// action name, action set. I don't think that will help but its simple and might work.
    If that doesn't work then I can help you with a script that you can attach to a different event. It check to see if it's been run before and if not run your action. You could attach the script to all events to make sure it gets run soon after startup.

  • How can I execute an action in Acrobat XI Pro using PowerPoint VBA?

    I am using Acrobat XI Pro and PowerPoint that came with Office 2013 running on Windows 8.
    I have an action in the Action Wizard that executes JavaScript code. It works fine when I click Tools | Action Wizard | Actions | <my script>, and Start in Acrobat XI Pro.
    I would like to be able to execute the same action using VBA in PowerPoint. Is this action considered a "menu item" in Acrobat? If so then I understand I can use AcroApp.MenuItemExecute to execute a menu item. What "menu item name" should I use? If not, is there another way to execute the same action using VBA in PowerPoint?
    Thanks.
    Regards,
    John

    No, it isn't a menu item. This area is a little complex, but it's the things which are, or which used to be on the menu. I don't think that there is a way to automate running actions, and I think this is entirely deliberate. However, there is an interface to execute JavaScript code, which is described in the Acrobat SDK.

  • Can only draw circle and square in Illustrator CS5 and Photoshop CS5

    I am experiencing a strange bug that seems to be affecting both Photoshop CS5 and Illustrator CS5. In Illustrator, when I try to draw a rectangle or ellipse I can only draw circles and squares. Also I can't change the color of selected objects. When I try to change its fill nothing happens. I can also only drag objects on the 0, 45 and 90 degree angles. Also I can no longer select off an object by clicking on the artboard. When I click on the artboard nothing happens.
    Similarly in Photoshop I can only draw straight lines using the brush tool. The  marquee tool is also not functioning properly. When I try to use the marquee tool the marching ants form a square but when I release the mouse it selects a rectangular portion. Strangely if I use the marquee tool and make selection I can press the shift key and add to it but this second selection's marching ants are not square but are properly rectangular.
    Since the problem seems to be affecting both Illustrator and Photoshop I'm thinking it's probably some kind of system conflict or perhaps an application running in the background is affecting it. Also if I restart my mac the problem goes away. Unfortunately the problem eventually returns.
    Anyway I'm pretty sure most of the suggested fixes involve systematically going through all the programs running in the background and trying to determine which if any might be affecting Illustrator and Photoshop but I just thought I'd post something in case someone else had the problem or knew of any fixes.
    I'm running CS5 on a MBP.
    Thanks!

    Ok I figured out the problem. It was another application called teleport which lets you control 2 macs with one mouse. It requires a hot key and in my case that was the shift key. Even though it was running it was still affecting me. Had to quit it and restart. If you're having a similar problem I'd check to see you're not running any other applications that can be activated with a hot key.

  • Can't see the artistic brushes in illustrator CS5

    can't see the artistic brushes in illustrator CS5

    Where exactly have you looked for them?
    Browsed the brushes libraries?

  • I can't find the 3D tool in illustrator CS5

    I'm working in a school computer with illustrator CS5 license, but for any reason I don't see the 3D section under Effects.
    Can someone help me? please

    It's not here?

  • Can't execute OS-level command from java stored proc

    I've written a couple simple java stored procs, the first of which writes an file and the second attempts a chown on it. I can write the file (which is written as the oracle user) just fine. I need to chown it, but can't. Here's the first proc:
    public static String writefile()
    String fileName = "/joetest/test.xml";
    try {
    File f = new File(fileName);
    FileOutputStream out = new FileOutputStream(f);
    PrintStream p = new PrintStream(out);
    p.println("this is only a test");
    p.close();
    return "create file successful!!!";
    } catch (Exception e) {
    return "Exception occurred writing file:"+e;
    Here's the proc I've been stuggling with:
    public static String chown(String inString)
    String[] command = {"/bin/sh", "-c", "/usr/bin/chown notjoe /joetest/test.xml"};
    if (inString != null) {
    command[2] = inString;
    try {
    Process p = Runtime.getRuntime().exec(command);
    return "Ownership change success!! "+p;
    } catch (Exception e) {
    return "Ownership change failure?? err="+e;
    The package is created with:
    CREATE OR REPLACE PACKAGE JOE.THISISATEST AS
    FUNCTION writefile
    return VARCHAR2
    AS
    LANGUAGE java
    NAME 'thisisatest.writefile() return java.lang.String';
    FUNCTION chown(Param1 VARCHAR2)
    return VARCHAR2
    AS
    LANGUAGE java
    NAME 'thisisatest.chown(java.lang.String) return java.lang.String';
    end;
    And I've granted the following privileges:
    begin
    dbms_java.grant_permission('JOE', 'java.io.FilePermission', '/joetest/test.xml', 'read, write, execute, delete');
    end;
    begin
    dbms_java.grant_permission('JOE', 'java.io.FilePermission', '/usr/bin/chown', 'execute');
    end;
    begin
    dbms_java.grant_permission('JOE', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    end;
    begin
    dbms_java.grant_permission('JOE', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    end;
    Here's the error that I'm getting:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Coincidentally, this is the same error that I used to get when I wrote the file without having been granted write privileges. Once I granted myself the proper 'write' permissions I could perform file IO just fine. Is there some runtime permission that I need to grant myself to run chown? I'm just guessing, as I can't find any permission like that in the java documentation. I have 'execute' permission on /usr/bin/chown and the oracle user can execute the command I'm attempting from the command line. ARRRRRGH.
    I am at my wits end with this. I've tried what seems like a thousand different syntaxes for the OS command and ran it from many different directories. Anyone have any thoughts at all as to why this is happening? I'm just clutching at straws now...

    Hmmmm. Granting 'execute' on '<<ALL FILES>>' to user JOE fixes this problem:
    begin
    dbms_java.grant_permission('JOE', 'java.io.FilePermission', '<<ALL FILES>>', 'execute');
    end;
    My security folks will not allow this when I port to production, but at least it is something.
    Message was edited by:
    user603023

  • How can I execute a dos command?

    I tryed so:
    import java.io.BufferedReader;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    public class Builder {
         public static void main(String[]args)
                   //makeFile();
                   execute();
         * @author Savio
         * @description Esegue comando dos
         * @throws IOException
         public static void execute()
              try
                   Runtime will = Runtime.getRuntime();
                   Process pid=will.exec("cmd /c c:prova.bat");
                   InputStreamReader isr = // step 3
                        new InputStreamReader( pid.getInputStream() );
                        BufferedReader br = new BufferedReader( // step 4.
                        isr );
                        String line;
                        while ((line = br.readLine()) != null)
                        System.out.println(line);
              catch (IOException e)
                             e.printStackTrace();
         * @author Savio
         * @description Crea e scrive un file
         * @throws IOException
         public static void makeFile() throws IOException
              FileOutputStream file=new FileOutputStream("c:/condor/bin/file.submit");
              PrintStream out=new PrintStream(file);
              out.println("### SUBMIT DESCRIPTION FILE ###");
              out.println("Universe = java");
              out.println("Executable = job.class");
              out.println("Jar_files = job.jar");
              //out.println("Arguments = "+args[0]+" "+args[1]+" "+args[2]+" "+args[3]);
              for (int i=0; i<10;i++)
                   out.println("Output"+i+"txt");
                   out.println("Error"+i+".txt");
                   out.println("Log"+i+".log");
    This doesn't works!!
    But, if I execute my .bat from dos it works... what's the problem?
    Can you help me!!!
    I'm angry! :)

    Please use code tags when posting code.
    Use ProcessBuilder or Runtime.exec(String, String[])

  • How can I export an .PLT file from Illustrator without using any other software but Illustrator

    I'm in the URGENT need of exporting a file to .PLT and no using any other software like the producer's software.

    You can't. AI doesn't produce .PLT files.

  • How can I change an image designed in Illustrator CS5 into linework?

    I've designed a complex floral pattern and need to change it to line work in order for conversion into a DWG format.
    Is this possible?

    Without seeing the artwork and knowing what methods you used to create it, nobody can tell you anything.
    Mylenium

  • All the fonts in the font menu within my Illustrator CS5 show up as invisible or blank.

    This happens unless you hover your mouse over them, and then the highlighted font will be visible until you take your mouse off of it.  This has only happened after I updated to the new Yosemite OS on my MacBook Pro.  Does anyone else have the same issue and is there something I can do to fix it?

    Scott,
    You may wish to roll back from Yosemite and wait to see whether the issues will be solved and reported as such.
    Weeding out in older plugins seems to have helped some in some cases. It also seems that JAVA Runtime may be involved, for some it seems to help to roll back to an ealier version, for others to update to the newest.
    All the above is more or less hearsay so far, with no definite final confirmation.
    In any case, there is something to be sorted out by someone.

Maybe you are looking for