Re: Setting STR# resource entries via AS
Re: Setting STR# resource entries via AS
- Subject: Re: Setting STR# resource entries via AS
- From: JJ <email@hidden>
- Date: Thu, 28 Nov 2002 23:31:45 +0200
>
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.
Hi, Gary!
Using Tanaka's osax...
To create/overwrite a STR# id 256:
#####################
set res to {"string one", "string two"}
MT Write Resource res to (choose file) of type "STR#" ID 256
#####################
To overwrite item 2 of resource STR# 256 (actually, it does exists):
#####################
set res to {"second string"}
MT Write Resource res to (choose file) of type "STR#" ID 256 index 2
#####################
To add a new item to resource STR# 256 (which actually has 2 items):
#####################
set new_item to "lolita"
set str_items to (MT Read Resource (choose file) of type "STR#" ID 256)
-- returns {"string one", "string two"}
set end of str_items to new_item
-- three items list
MT Write Resource str_items to (choose file) of type "STR#" ID 256
#####################
For a cross-OS solution, I'd suggest you "X-Commands"
(
http://www.kanzu.com/), which works as Tanaka's osax, with a different
syntax (read string resource/write string resource)
Bye!
JJ
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
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.