Hi All,
I am working on a plugin for adobe illustrator CS6 by using adobe CS6 SDK. By using this plugin I need to add a Me nu Item In File Menu of Adobe Illustrator.
I have used the following code for this:
______________________________________________________________________ ________
SPBasicSuite *mBasic = message->d.basic; AIMenuSuite *sAIMenu; mBasic->AcquireSuite(kAIMenuSuite,kAIMenuVersion, (const void**)&sAIMenu); SPPluginRef plugin; AIPlatformAddMenuItemDataUS menuData; AIPlatformAddMenuItemDataUS pluginMenuData; const char *menuGroupCStr = "MyGroup"; const char *menuCStr = "Menu..."; const char *pluginCStr = "MMMEEENNNUUU"; menuData.groupName = kEditMenuGroup; menuData.itemText = ai::UnicodeString(menuCStr); pluginMenuData.groupName = menuGroupCStr; pluginMenuData.itemText = ai::UnicodeString(pluginCStr); const char *Key=NULL; AIMenuItemOption options=kMenuItemIsSeparator; //AIMenuItemHandle *menuItem; AIErr err = sAIMenu->AddMenuItem(message->d.self,NULL,&menuData,0,&g->showMenuIte m); if (error) goto error; But i have nothing as output. Can any of you please suggest me that what should i do in this code.
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.
SPBasicSuite* sBasic = message->d.basic;
AIMenuSuite* sAIMenu = 0;
sBasic->AcquireSuite(kAIMenuSuite,kAIMenuVersion, (const void**)&sAIMenu);
AIPlatformAddMenuItemDataUS menuData;
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.
Sorry A. Patterson but nothing is working in my appliaction,.,,
I am using VS-2010 and AI C6.
Something else...??
H Harsh,
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.
regards
Shyam
Hello Shyam,
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.
Regards
Harsh
North America
Europe, Middle East and Africa
Asia Pacific