# Copy Path Custom Shortcut

**URL:** https://qa.fmod.com/t/copy-path-custom-shortcut/16944
**Category:** FMOD Studio
**Created:** [March 25, 2021, 10:13pm UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944 "2021-03-25T22:13:45Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Douku](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/douku/32/8794_2.png) [@Douku](https://qa.fmod.com/u/Douku)
#### Post date: [March 25, 2021, 10:13pm UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/1 "2021-03-25T22:13:45Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)
#### Post date: [March 25, 2021, 10:37pm UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/2 "2021-03-25T22:37:18Z")

</div>

It seems to be possible to retrieve the path by a script, using [Event.getPath()](https://fmod.com/resources/documentation-studio?version=2.1&page=scripting-api-reference-project.html#eventgetpath), however I’m not sure it is possible to have it stored in the clipboard!  
To be continued…

---

<div class="post-metadata">

### Author: ![Douku](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/douku/32/8794_2.png) [@Douku](https://qa.fmod.com/u/Douku)
#### Post date: [March 25, 2021, 10:51pm UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/3 "2021-03-25T22:51:33Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![aishi](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/aishi/32/82_2.png) [@aishi](https://qa.fmod.com/u/aishi)
#### Post date: [March 25, 2021, 10:59pm UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/4 "2021-03-25T22:59:00Z")

</div>

Here’s some examples in the documentation: [FMOD - Scripting (custom menus)](https://www.fmod.com/resources/documentation-studio?version=2.1&page=scripting-terminal-reference.html#custom-menus)  
FMOD Studio will detect the script files in [these](https://www.fmod.com/resources/documentation-studio?version=2.1&page=scripting-terminal-reference.html#script-files) directories.

---

<div class="post-metadata">

### Author: ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)
#### Post date: [March 25, 2021, 11:03pm UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/5 "2021-03-25T23:03:48Z")

</div>

> [@Douku](#):
>
> How would FMOD know to copy the path of the selected event when ctrl+alt+c is pressed

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).

---

<div class="post-metadata">

### Author: ![Douku](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/douku/32/8794_2.png) [@Douku](https://qa.fmod.com/u/Douku)
#### Post date: [March 26, 2021, 12:00am UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/6 "2021-03-26T00:00:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![rontt](https://avatars.discourse-cdn.com/v4/letter/r/779978/32.png) [@rontt](https://qa.fmod.com/u/rontt)
#### Post date: [November 11, 2021, 2:04am UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/7 "2021-11-11T02:04:02Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)
#### Post date: [November 11, 2021, 10:28pm UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/8 "2021-11-11T22:28:57Z")

</div>

> [@rontt](#):
>
> Was the question about how to copy a javascript string to the clipboard answered?

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

- [Accessing the System Clipboard with JavaScript – A Holy Grail? | Software Salad](https://brooknovak.wordpress.com/2009/07/28/accessing-the-system-clipboard-with-javascript/)
- [https://techoverflow.net/2018/03/30/copying-strings-to-the-clipboard-using-pure-javascript/](https://techoverflow.net/2018/03/30/copying-strings-to-the-clipboard-using-pure-javascript/)
- [How To Copy to Clipboard](https://www.w3schools.com/howto/howto_js_copy_clipboard.asp)

---

<div class="post-metadata">

### Author: ![rontt](https://avatars.discourse-cdn.com/v4/letter/r/779978/32.png) [@rontt](https://qa.fmod.com/u/rontt)
#### Post date: [November 12, 2021, 4:16am UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/9 "2021-11-12T04:16:01Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)
#### Post date: [November 21, 2021, 11:48pm UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/10 "2021-11-21T23:48:51Z")

</div>

> [@rontt](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![Douku](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/douku/32/8794_2.png) [@Douku](https://qa.fmod.com/u/Douku)
#### Post date: [November 22, 2021, 3:50am UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/11 "2021-11-22T03:50:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![lnw\_bweber](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/lnw_bweber/32/6482_2.png) [@lnw\_bweber](https://qa.fmod.com/u/lnw_bweber)
#### Post date: [April 2, 2024, 7:37pm UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/12 "2024-04-02T19:37:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)
#### Post date: [April 9, 2024, 7:57am UTC](https://qa.fmod.com/t/copy-path-custom-shortcut/16944/13 "2024-04-09T07:57:05Z")

</div>

> [@lnw\_bweber](#):
>
> 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.
