Writing vers resource to files

I am trying to automate the processing of bundles after they are created with Installer VISE. I want to dive into the package and modify the ‘vers’ resource of the main application file.

I’ve tried using the Santimage OSAX and also tried scripting Resorcerer itself. I think it may work if I understood how to fomat the data. But after a couple days of searching for examples and experimenting on my own, I can’t seem to get it to work.

The closest I have gotten is:

tell application "Resorcerer 2.4.1 (OSX)"
  open file "myInstaller"
  set the contents of resource {"vers", 1} of file 1 to {1, 0, "final", 0, "VerUS", "1.0", "1.0, Copyright © 1996 Your Company"}
end tell

This puts some data into the ‘vers’ resource, but not the data I am trying to tell it. For example, rather than ending up with version 1.0.0 in the resource, I get 64.4.12 or something like that

Does anyone know of an easy way to write the ‘vers’ version resource information using AppleScript?

Thank you.

Trever Wilhelm

Is the file that you want to modify a plist? If so, you might be able to use the shell’s ‘defaults’ to do this (it can be wrapped neatly with AppleScript). Check out ‘man defaults’ in the Terminal.

Thanks for the tip Rob. That may come in handy down the road. But for now, this is a file with a data and resource fork. Not a plist file.

I will also need to edit the plist at the upper level of the bundle. But I need to change the ‘vers’ resource for OS 9 systems.


Here you can find a little editable jewel:
It was written for OS 9 and uses Dialog Director for the GUI and Akua Sweets for hex-encoding-decoding and read/write resources.
You can easilly create vanilla solutions for hex encoding-decoding and satimage osax for read-write resources.
So, you may need only the encodedata handler from VersionGUI, which is easilly adaptable…