Can I rename .hyperesources folder?


(Matteo Discardi) #1

Hi all. I have to prepare a HTML interface for a DVD (yes, DVD, incredible) and my client does not want a folder name “blablabla.hyperesources”.
Can I have a way to choose the right name for the folder and edit it inside the file (before export)? A right name can be “script” or “resources” or something similar, best is to let me to choose name easily.
Tnx in advance


(Jonathan Deutsch) #2

Your case is that you do want a folder, but you do not want the name .hyperesources, correct? (there are different ways to remove the folder itself, but that would be a different tip!)

In this case I’d probably just recommend manually changing the name after export. You can just do a find/replace for it in these files:

  • filename.html
  • filename.hyperesources/filename_hype_generated_script.js

Afterwards just change the folder name to whatever you changed it to.


(Matteo Discardi) #3

Yes, correct. I of course can make changes manually (I use BBEdit for this), but I’m searching a way to automate process. I think a Export window that ask me the name of the folder (a flag like “change name”) or something to add in preferences.
But thanks anyway for help


(Jonathan Deutsch) #4

There’s not a UI way to do so, but Hype does have a plugin structure called Export Scripts. This does allow automating changing the name of the .hyperesources folder.

You could probably get away with using the one called “OrganizedAssets” – its goal is to put files in various js, img, video, etc. folders. However with one small change you can use it to make a top-level folder named something different.

After installing, the python file will be located in the ~/Library/Application Scripts/com.tumult.Hype2/OrganizedAssets/ folder. Open the OrganizedAssets.hype-export.py file in the editor of your choice. You’ll find line 80-81 looks like:

		if int(args.url_type) == HypeURLType.ResourcesFolder:
			url_info['url'] = "."

You can change the "." to the folder name you’d like, like so:

		if int(args.url_type) == HypeURLType.ResourcesFolder:
			url_info['url'] = "myfoldername"

Then use the File > Export as HTML5 > OrganizedAssets… menu to use this.