Copy Path Custom Shortcut

Hi, I am trying to create my own custom action shortcut to copy the path of a selected event. I would love to be able to pres ctrl+alt+c to do this. I have done extensive googling haha but can’t seem to figure out where to start! I have looked through the FMOD API, FMOD keyboard shortcut reference, and other websites.

If anyone could help me out or point me in the right direction that would be amazing!

It seems to be possible to retrieve the path by a script, using Event.getPath(), however I’m not sure it is possible to have it stored in the clipboard!
To be continued…

Thanks, this is a good start! haha

I am not exactly sure how custom shortcuts would work… How would FMOD know to copy the path of the selected event when ctrl+alt+c is pressed. Does the script need to always be running in the background or does FMOD do this itself or does it just know? I couldn’t find any examples online of custom commands/shortcuts in play.

Here’s some examples in the documentation: FMOD - Scripting (custom menus)
FMOD Studio will detect the script files in these directories.

By indicating keySequence: "Ctrl+Alt+C" in the script. Check the exemples built in.
Loaded scripts are always active. You can decide when they should be active by setting isEnabled: function () with the conditions you want (it should return true to be active).

Thanks, guys! I’ll keep you updated on how I go.

1 Like

Was the question about how to copy a javascript string to the clipboard answered? I also want to write a script that does build paths and copies them to the clipboard. I know how to get the path, just not how to copy it to the clipboard.

1 Like

While I’m not a JavaScript expert, a quick Google found multiple guides on how to send text to the clipboard. For example:

All those about using web html documents.

FMOD doesn’t implement window.clipboardData.setData("")

I hope they will consider this, it would be useful for scripts.

Thanks for the suggestion. I’ve added this to our feature/improvement tracker.

1 Like

This is exactly what I was struggling with; copying to the clipboard. This would be great.

Hi @joseph ! I would be interested also in seeing clipboard functionality in the scripting API, if this is still in the feature tracker.

It is, indeed, still in our tracker! I’ll add you to the list of people interested in this feature.