Skip to main content
Known Participant
April 24, 2009
Question

Action calling...

  • April 24, 2009
  • 1 reply
  • 2082 views

Hi,

    I want to call action from illustrator sdk.  I recorded one action for drawing polygon and called from sdk but its not working correctly.  I think i did not pass parameters correctly. But i dont know how to pass parameter for tat action call. When i see action it show 4 parameter center X, center Y, radius, sides but when i saved that action it shows 8 parameter count.  I dont know how many parameters have to pass? And how to pass tat?  If anyone knows pls let me know...

   Thanks in advance.

This topic has been closed for replies.

1 reply

A. Patterson
Inspiring
April 24, 2009

Are you trying to call the action you recorded? Or are you trying to call an action for one of the operations your recorded action used? If its the former, you should be able to just specify the name I believe, and you should get whatever parameters you recorded.

If you're trying to invoke an action for a specific Illustrator operation, yes, you'll need to know the parameters & specify them properly.

Oviya___Author
Known Participant
April 25, 2009

Hi,

    Im new to the illustrator... So i dont know how to find that parameters.. It varries from action palette and action file (like default.aia) when we open and see tat file. How do i know which one is correct no.of parameters and how to pass tat to call tat action we recorded...

  Some of the built-in actions in the header files(AIDocumentAction.h) have internal name of the action(adobe_closeDocument) and parameters also (all, save like tat)... But the action file which i recorded contains like tat...

Swatchdeletion.aia

/version 2
/name [ 4
73776174
]
/isOpen 1
/actionCount 1
/action-1 {
/name [ 3
73726d
]
/keyIndex 0
/colorIndex 0
/isOpen 1
/eventCount 1
/event-1 {
/internalName (ai_plugin_swatches)
/localizedName [ 8
5.37762E+15
]
/isOpen 0
/isOn 1
/hasDialog 1
/showDialog 1
/parameterCount 1
/parameter-1 {
/key 1835363957
/showInPalette -1
/type (enumerated)
/name [ 13
44656c65746520537761746368
]
/value 3
}
}
}

      This is swatch deletion recorded by manually..  When i calling its not working correctly.. i think i have to pass swatch name or index to tat... but dont know how?  Pls tell me how to find that parameters and calling tat?

    Thanks in advance.

Oviya___Author
Known Participant
April 29, 2009

reeading your .aia, you have got only one parameter to set, which is type of enumerated.

you could try to do as follow:

    AIErr result = kNoErr;
    AIActionParamValueRef valueParameterBlock = NULL;
    ActionDialogStatus dialogStatus = kDialogOff;

    try
    {
        result = sAIActionManager->AINewActionParamValue(&valueParameterBlock);
        aisdk::check_ai_error(result);   

        if (valueParameterBlock)
        {           
            result = sAIActionManager->AIActionSetEnumerated(valueParameterBlock, "yourkey", "your key value"));

            aisdk::check_ai_error(result);           
        }    
    }
    catch(ai::Error& ex)
    {
        result = ex;
    }

You could use this site to convert your key from int to a readable format!

http://www.vortex.prodigynet.co.uk/misc/ascii_conv.html

then only call the command correclty!

thomas.


Hi,

      When i use tat code it says some error for this line

               aisdk::check_ai_error(result);

     Have to add any header file or namespace to tat?....

     sAIActionManager->AIActionSetEnumerated(valueParameterBlock, "yourkey", "your key value"); But It contains 4 parameters

ASErr ASAPI (*AIActionSetEnumerated)(AIActionParamValueRef param, ActionParamKeyID key,  const char* name, ASInt32 value); What is ASInt32 value? I couldn't able to open the site which u gave also....


My Code is here...

AIErr result = kNoErr;
    AIActionParamValueRef valueParameterBlock = NULL;
    ActionDialogStatus dialogStatus = kDialogOff;

    try
    {
        result = sAIActionManager->AINewActionParamValue(&valueParameterBlock);
        //aisdk::check_ai_error(result); 

        if (valueParameterBlock)
        {          
            result = sAIActionManager->AIActionSetEnumerated(valueParameterBlock, 'indx', "Smoke",13);

            //aisdk::check_ai_error(result);          
        }   
    }
    catch(ai::Error& ex)
    {
        result = ex;
    }
MessageBox(NULL,"Bef action","",0);
result = sAIActionManager->PlayActionEvent("ai_plugin_swatches", dialogStatus, valueParameterBlock);  
result = sAIActionManager->AIDeleteActionParamValue(valueParameterBlock);
MessageBox(NULL,"Aft action","",0);

It displays messagebox before and after playaction but not working operation of tat corresponding action (delete swatch).  I think i did mistake in

  result = sAIActionManager->AIActionSetEnumerated(valueParameterBlock, 'indx', "Smoke",13);   Pls tell me is it correct or not?

Thanks in advance.

Sudha