Moving java script functions from one hype document to another?

I have a large number of js functions I have written within the resources on one Hype document that I would like to copy to another document without having to manually "create", "name" and "paste" the contents of each function. Is there a way to do this? I tried dragging them from one resource list to another but that didn't work.

Thanks in advance for any help you can provide!!

  • Jeff

Unfortunately there's not a great way to do this.

It is a good feature request that functions from the resource library should be drag-and-droppable or copy/pastable.

The "hackiest" way would be to leverage the fact that when importing a symbol, functions will be imported into the parent document. While you can put stuff into a symbol and copy/paste it, you could also take your .hype document, rename a copy to ".hypesymbol" and then drag it into your destination document. (You may need to turn on showing file extensions in the Finder to do this). It turns out the hype document format is basically the same as a hype symbol that can be imported, so this magically works. Once you do the import, you can then delete the symbol and the functions should remain. My recollection on the behavior is that overlappingly named functions don't get imported, so watch out for that.

2 Likes

Thanks so much Jonathan, I'll give this a try!

1 Like