The code looks mostly right. pluginMenuData & menuGroupCStr don't actually get used, so you can cut them out
That said, it looks like you're adding the menu item to the Edit Menu, not the File Menu. So you're probably looking for it on the wrong menu. If you want it on the File menu, you'll need to specify the sub-group on that menu you want it to appear in. That's the group that starts with kOpenMenuGroup and ends with kSendMenuGroup in AIMenuGroups.h.
First though, see if its showing up in the Edit menu! If that's working, you just need to adjust your target group and you're good to go.
Hi , A. Patterson thanks for your instant response.
Can you please post samples of code that i should use because i have been using the same code in my application but it is not working. I have no idea what is wrong with it. If you have any idea please tell me .
SPBasicSuite* sBasic = message->d.basic;
AIMenuSuite* sAIMenu = 0;
sBasic->AcquireSuite(kAIMenuSuite,kAIMenuVersion, (const void**)&sAIMenu);
menuData.groupName = kOpenMenuGroup;
menuData.itemText = ai::UnicodeString("My test menu...");
const AIMenuItemOption options = 0;
AIMenuItemHandle menuHandle = 0;
AIErr error = sAIMenu->AddMenuItem(message->d.self, 0, &menuData, options, &menuHandle);
// check error
This is basically what I do in my stuff. That should create a menu in the 'File' menu, near the top.
Okay Thanks Patterson,
I have added a Menu Item in file menu now can you please tell me how can i call a JScript on this button click.
I have no idea how to do that in Illustrator. I'm not even sure if its possible. You can invoke actions, and those can probably run scripts.
Am a newbie using the Adobe illustrator CS4. Am actually trying to customize the menu by addign a plugin.I have downloaded the SDK for doing the same. I see that you are already adept at that.If you can send me a step by step procedure to create a Custom Menu Item it would be of great help to me.
Just check the sample code. Most of the plugins in there have to create menuitems to let you run their samples.
you are using CS4, Right.
I have done with that.
if you want to add a custom Menu Item just Download AI SDK CS4 and follow MenuPlay project avaliable in that.
I dont think after using that you will be needed any help.
If any than please update the post I will help you for sure.