Can I rename .hyperesources folder?

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

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.

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

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.

3 Likes

Thank you Jonathan for this solution, it was helpful for our needs to conform content for our CMS. The CMS does not allow "." in the folder names and the modified export script worked to generate compliant content.

Could the Hype team consider using a "-" instead of a "." for default exporting? Or is there a reason you chose to use a "." in the folder name in the first place?

Thank you!

Which CMS are you using? (If it is a popular enough one then adding an option could be on the table.)

The funny thing is that it wasn't an "in the first place" choice :slight_smile:. In Hype 1.0 it was originally with an underscore, "documentname_resources". Apple later introduced Mac App Sandboxing which only allowed filenames entered in a save panel to be explicitly written out. This meant we could not write out a .html file and a folder next to it. Apple eventually made a fix for this general problem in Mac OS X 10.8 allowing writing out multiple files if they have the same base name with differing extensions. Hence to provide a folder next to a .html file output, it has to use the dot of an extension to get around sandboxing restrictions.

For more obscure trivia, Hype 1.6.0, which adopted Sandboxing, first used ".resources" as the extension. Unfortunately we quickly learned this caused some weird conflict with Microsoft IIS-based web servers and settled upon the ".hyperesources" to use as the extension, since this worked just fine.

In general ".hyperesources" folder names have been more compatible than I would have expected. Export Scripts are a definite solution, but I understand clunkier than may be desired if this is the only outgoing modification needed.