Relative File Location option

  1. What do you want to see in Hype?
    Relative File Linking.

The idea is to have an option where we can tell Hype that the path written in the final js should be “relative” rather than absolute. Possibly achieved via a Right Click on the asset and a new option of “Relative File Location”. This would then write the path as local to the parent file. Granted if people had the parent file many steps out, it could be problematic. How to create the path in Hype might be achieved by having an additional dialog that allowed coding “…/folderName/fileName”.

The benefit comes from sites that share assets. For instance, in the example shown, the animated “Waving Pete” is used in other areas of the website. Updating the asset in a single location saves having to update multiple locations which removes the efficiency of shared assets.

  1. Have you found a workaround for this problem?
    Nope. As a Hype project generates a folder with linked assets. Of course, the changing of a file in that folder structure works similar to this feature request but this removed the efficiency of the request.

  2. How high of a priority is this for you?
    It would be nice to have and a time-saver.

1 Like

Here is a solution as Hype has this callback in code already:

Download:
HypeResourceLoadModification.hype.zip

Demo:
HypeResourceLoadModification.html

3 Likes

Thank You! :boom::+1:

Max, your showing that this can be achieved with “added” coding. Good job, yes I see how that is one way to achieve the goal.

But, my suggestion is to make this a simple method that works with the IDE and not require added coding other than maybe passing a string as the path. In other words the point is efficiency and fewer keystrokes to achieve the goal.

1 Like

I totally get that and so does the Team at Tumult… I guess. Was just trying to help out in the meantime. It’s one line of code per resource. Not much coding going on here. Best regards from Berlin. :dove::v:

1 Like

Thanks Max. I would add your code to the Snippets Library if there was one built into Hype :wink:

Thanks again for your input, it’s appreciated.

Thanks for the request! As seen by the API and Export Scripts, Hype’s runtime has the ability to change how it addresses resources to use a full URL instead of a name to be found in the .hyperesources library. We’ve been wanting to expose this in the Resource Library UI for a while.

However there’s a second aspect of this that is more difficult; specifically having a resource that will be written out to a path beyond that specified by the export save dialog – this is not allowed by macOS sandboxing security measures. (though there are some ugly/error-prone ways around it)

2 Likes