Because I was raised on the PC side of things, my knowledge of OS/X Packages is limited. But I was wondering if it would be possible to create a Package containing an HTML file and its resource folders (css, js, etc), and be able to use it somehow with the “Custom HTML Prompt” action?
My thought is that the Custom HTML Prompt action could be pointed at the HTML file inside the package, and assuming the folder structure inside the package is correct, it would have no problems getting to the resource folders as well?
You might ask why I’d want to do this. The reason is, it would make it easier to deliver an updated version of a macro that uses a Custom HTML Prompt. The user just has to replace a single file, instead of a bunch of files.
myPackage.pkg.zip (3.7 KB)
Open the package and see the structure.
set pkgFile to alias ((path to downloads folder as text) & "myPackage.pkg:")
set myResource to path to resource "template01" in bundle pkgFile
Be sure to scope-out the extra terminology in path to resource.
Thanks. How did you create the package file?
Create a folder, and give it a “.pkg” suffix.
As it turns out, at least on my system, I was able to refer to my HTML file in a Custom HTML Prompt action like this:
No need for AppleScript. Do you think this would work on other people’s machines? (Not the hard-coded location of the pkg file of course, just the path to the html file inside it.)
A .pkg “file” is simply a directory the OS displays as a file.
You can right-click on any package file and show its contents.