Setting STR# resource entries via AS
Setting STR# resource entries via AS
- Subject: Setting STR# resource entries via AS
- From: Gary Lists <email@hidden>
- Date: Thu, 28 Nov 2002 13:31:08 -0500
Hello.
I have created an AS that moves (copies) resource files into another
application's resource fork, replacing resources of the same type/ID. This
works just fine with my test resources, which are created using ResEdit.
Specifically, for my tests, I have a ResEdit file that contains a STR#
resource and a MENU resource and I have supplied all the actual strings in
those resource templates.
However, the intended application [1] is have the end user supply the string
values and then move those into the file's resource. Just copying a resedit
file into the destination works fine, but accessing specific indices within
each resource is failing for me.
Can anyone offer a pointer to a URL with sample code, or insight into your
own usage of the of one of the available scripting additions for this
purpose? [2]
If you have further questions, or need clarification as to my (perhaps not
well-stated) need, then just reply that you'd like to communicate off list,
and I will do so.
Thanks in advance,
Gary
[1]
More detail on the application:
I will use the STR# resource for description, as the process should be the
same for the MENU strings as well.
In my case, I am always replacing the STR# 256 in the particular file. The
structure of this is:
STR# resources -->
ID 256 -->
STR# ID = 256 -->
NumStrings 12
1) *****
The string [theString] < theString is what I want the user to supply
2) *****
The string [theString]
...
These are all URLs, and they have a corresponding MENU resource, which also
is string data with the actual menu name, with the STR# resource being the
URL associated with that menu choice.
So, the user should enter the menu name and the URL, and I should put those
values into the appropriate resource slots.
If I construct the test resource packets myself, I am successful in having
AS move them into the original file, overwriting already existing ID's.
That is not the problem.
I can't figure out how to get the values into the actual slots (1, 2, 3, and
so on) holding theString value.
My difficulty arises in inserting into a specifc index: STR# ID 256 (string
#1), (string #2) and so on.
Getting the user data is not the problem, as I can build the [menu name:URL]
string pairs just fine using AS lists.
[2]
I have tried using the following OSAXen, and am sure that it is my
scripting, as the dictionaries for these seem to imply that I can access
(read/write) the specific index.
Here's what I have available as of this writing:
ResMover 1.0 (by Chris Reed [from the DD distribution?])
Has Resource 1.10 (from the Lab and Network Maintainer v3/Mark Fleming)
Tanaka's 2.0 (MT Write Resource command)
Resource Utilities 1.1b1 (from Chris Hyde, )96-98)
I can't use a commercial product, and prefer either a freeware or GNU
license, as I need to include the OSAXen in my distribution.
--
Do not reply via email. Incoming replies are auto-deleted.
Please post directly to the list or newsgroup. Thank you!
Really need direct? Rot me at:
email@hidden
Lbhe fhowrpg zhfg ortva "abgwhax:" (ab dhbgrf)
Avpr gb zrrg lbh! Qba'g fcnz zr.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.