• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Setting STR# resource entries via AS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: AS link to MySQL?
  • Next by Date: Re: Detecting if text is styled
  • Previous by thread: Re: Setting STR# resource entries via AS
  • Next by thread: Applescript to export Quicktime movies
  • Index(es):
    • Date
    • Thread