Embed an HTML file into a project for jweb?

bkshepard's icon

Is it possible to embed an HTML file inside a patcher/project so that the jweb object can display it no matter where the patcher is opened? I'd prefer to have it embedded rather than accessed via the web in case the user is not online at the time. Thanks.

bkshepard's icon

Is this possible?

I'm trying to build a collective that uses small html files for user instructions that display in the jweb object. I've added the files to the build script and I'm sending a readfile message with the name of the html file to the jweb object, but they don't appear. As I mentioned above, I'd really rather use an embedded file in case the user is not online at the time. Any suggestions? Thanks.

Source Audio's icon

what are you building ?
standaone app ?

If I remember correctly, one can't embed media fies into collective
to use with read messages.
you need to place folder with html files in search path in your app
to use readfile message.
having subfoler, one would probably need to get absolute path
to the folder.
at last, that is what I usually do.
--------
If there is nothing that forces you to use html format,
I would use something else to display instructions, and avoid the need
of embedding CEF framework and so spare hundreds of MB standalone size.

bkshepard's icon

Thanks SA. Just collectives, not standalones so they’re not all that big. I’ve added a way to provide the absolute path to a subfolder with the files which works as long as people don’t move things around. I like the jweb object because formatting the instructions as html files gives me much greater control over their appearance and function. I was just hoping I could embed the html files but that doesn’t seem to be possible. I appreciate it.

Source Audio's icon

if you export amxd file from consolidated project, then media files get accessible using readfile message.
that is because amxd fies get extracted into users
Documents/Max 8/Max for Live Devices/ folder

bkshepard's icon

Ooh, thanks for that tip. I'll give that a try!

bkshepard's icon

Hmmm...
I have consolidated a project, but the "Export Max for Live Device..." option is grayed out

Source Audio's icon

Ah, that stupid max4live stuff...
use this empty device.
rename it as you wish, add to project as main patcher,
paste your stuff in there,
and it should work.

empty.amxd
amxd 1.85 KB

P.S.
actually it is not really needed, I have it simply like that.
I think you need to right-click on the patcher and set
open on project load.

that enables amxd export