Copy link to clipboard
Copied
The C++ SDK does contain relevant documentation, but
For example
IKBSCSetsManager::KBSCArea IShortcutManager::GetShortcutKBSCArea()
I don't know how to operate the IKBSCSetsManager. How do I obtain the interface?
Copy link to clipboard
Copied
Hi,
I have never tried creating the shortcuts from the code, but you can get the access IShortcutManager.
IShortcutManager belongs to kActionManagerBoss.
InterfacePtr<ISession> iSession(::GetExecutionContextSession(), UseDefaultIID());
InterfacePtr<IApplication> iApplication(iSession->QueryApplication());
InterfacePtr<IActionManager> iActionManager(iApplication->QueryActionManager());
InterfacePtr<IShortcutManager> iShortcutManager(iActionManager, UseDefaultIID());
// Now you can use iShortcutManager
- Rahul Rastogi
Adobe InDesign SDK C++ Custom Plugin Solution Architect
Copy link to clipboard
Copied
Thank you.
Assuming IShortcutManager has been obtained,
how do I obtain IKBSCSetsManager?
Copy link to clipboard
Copied
IKBSCSetsManager belongs to kWorkspaceBoss
InterfacePtr<ISession> iSession(::GetExecutionContextSession(), UseDefaultIID());
InterfacePtr<IWorkspace> iWorkspace(iSession->QueryWorkspace());
InterfacePtr<IKBSCSetsManager> iSetsManager(iWorkspace, UseDefaultIID());
// now, you can use iSetsManager
Copy link to clipboard
Copied
Thank you so much, I'm glad I asked.
I'd like to send money to you, just like how viewers can send money to streamers on YouTube.
I'd like you to add that kind of feature to the community...
Copy link to clipboard
Copied
The IKBSCSetsManager interface contains the notethis interface is deprecated.
@SEE IShortcutManagerand the method did not function properly.
(Displaying the shortcut dialog once resolves the issue)
The IShortcutManager interface does not appear to have a replacement for the SwitchToSet method of IKBSCSetsManager.
Is it currently impossible to select a shortcut set?
Copy link to clipboard
Copied
If I remember that correctly, you need a command where the CmdData is missing in the SDK.
There is a way via scripting, though.
Copy link to clipboard
Copied
Thank you.
I'll create a new question about the method using scripts and ask everyone.
Copy link to clipboard
Copied
Sorry for the unspecific response, I was away from my working machine.
The command is kKBSCSetCurrentSetCmdBoss, the missing interface is IID_IKBSCSETCURRENTSETCMDDATA.
This does not help with anything though because of missing header for the CmdData as I remembered. As far I have looked there is also no notification.
"Displaying the shortcut dialog once solves …" - that's typical, InDesign setter methods are often very raw and only manipulate direct data. Calling them directly misses required database updates and also any dependencies. Such functionality mostly goes thru commands, or facade and util methods.
For the scripting side, here another screenshot:
The entry in general preferences just repeats the property name, likely it is the applied shortcut set.
Copy link to clipboard
Copied
So it's not possible in C++ but can be done in Script, huh? I see things like this happen too.
Thank you for your thoughtful reply.
Copy link to clipboard
Copied
C++ can call scripts, or directly invoke script requests.
It is just unneccessary overhead, e.g. a day or two to get it going for the first time.
Copy link to clipboard
Copied
The world of the C++ SDK is endlessly deep and vast.
I intend to proceed step by step.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now