Extracting Resources from MacOS X Resource Files

2009-01-21 Thread Dave

Hi,

Is there a way I can extract resources from a MacOS X .rsrc file?  
(e.g. a Theme file). Specially I have a resource file that has a  
number of "icns" resources and a number "png" resources that I'd like  
to extract into separate ".icns" or ",png" files.


Thanks in advance
All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Extracting Resources from MacOS X Resource Files

2009-01-22 Thread Richmond Mathewson
Richard Gaskin wrote:

"It appears to be a file, and if indeed it contains icons it's just 
another example of Apple not following their own guidelines, which 
suggest that icons should be put in icns files within the app's bundle."

download this:

http://www.geekspiff.com/software/themepark/

it will open the iTune.rsrc file and reveal that it contains:

icns (Tut, tut)
PICT files (very, very old-fashioned)
PNGf images

sincerely, Richmond Mathewson.



A Thorn in the flesh is better than a failed Systems Development Life Cycle.




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Extracting Resources from MacOS X Resource Files

2009-01-22 Thread Richmond Mathewson
Stephen Barncard wrote:

"It doesn't appear to be in my distribution."

Humpf:

If you have a 3-button mouse right-click on the iTunes.app icon
(otherwise do the fiddley thing with a ctrl button):

go down the contextual menu and choose "Show Package Contents"

this will crack open the iTunes package:

iTunes/Contents/Resources/iTunes.rsrc

sincerely, Richmond Mathewson.



A Thorn in the flesh is better than a failed Systems Development Life Cycle.




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-21 Thread Mark Schonewille

Hi Dave,

Perhaps ResFool is what you are looking for. You can also use the  
getResource command in Revolution.


--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
Dutch forum: http://runrev.info/rrforum

We are always looking for new projects! Feel free to contact us to  
discuss your custom software project!


On 21 jan 2009, at 15:13, Dave wrote:


Hi,

Is there a way I can extract resources from a MacOS X .rsrc file?  
(e.g. a Theme file). Specially I have a resource file that has a  
number of "icns" resources and a number "png" resources that I'd  
like to extract into separate ".icns" or ",png" files.


Thanks in advance
All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-21 Thread Dave

Hi,

I tried the getResource command in revolution, it doesn't seem to  
work with Mac OS X .rsrc files. For instance when I run this script  
from a button:


on mouseUp
  local myFilePathName
  local myResourceData
  local myResult

  put "/Users/Dave/Desktop/iTunesImages/myFile.rsrc" into  
myFilePathName


  put getResources(myFilePathName) into myResourceData
  put the result into myResult

end mouseUp

myResourceData and myResult are both empty, yet when I look at the  
file with ThemePark it show the Icons and Files ok. The myFile.rsrc I  
used here was taken from iTunes in the Resources folder inside the  
App Package.


What I really want is to convert the pngs and icns into JPEG images.

All the Best
Dave

On 21 Jan 2009, at 14:17, Mark Schonewille wrote:


Hi Dave,

Perhaps ResFool is what you are looking for. You can also use the  
getResource command in Revolution.


--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
Dutch forum: http://runrev.info/rrforum

We are always looking for new projects! Feel free to contact us to  
discuss your custom software project!


On 21 jan 2009, at 15:13, Dave wrote:


Hi,

Is there a way I can extract resources from a MacOS X .rsrc file?  
(e.g. a Theme file). Specially I have a resource file that has a  
number of "icns" resources and a number "png" resources that I'd  
like to extract into separate ".icns" or ",png" files.


Thanks in advance
All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-21 Thread Richard Gaskin

Dave wrote:

I tried the getResource command in revolution, it doesn't seem to  
work with Mac OS X .rsrc files. For instance when I run this script  
from a button:


on mouseUp
   local myFilePathName
   local myResourceData
   local myResult

   put "/Users/Dave/Desktop/iTunesImages/myFile.rsrc" into  
myFilePathName


   put getResources(myFilePathName) into myResourceData
   put the result into myResult

end mouseUp

myResourceData and myResult are both empty, yet when I look at the  
file with ThemePark it show the Icons and Files ok. The myFile.rsrc I  
used here was taken from iTunes in the Resources folder inside the  
App Package.


What I really want is to convert the pngs and icns into JPEG images.


The getResources function works on the resource fork only, added back in 
the OS 8.5 days and increasingly Apple is migrating away from using 
resource forks so it's not so useful under OS X.*


So while that explains why you're not getting what you're looking for 
with that, I'm confused about what's in iTunes .rsrc file.  It seems its 
icons are stored in  several dozen .icns files within the bundle's 
"Resources" folder.  With a tool or external that can extract the image 
data from them (could conceivably be done with a script too) it would 
seem those icns files are where you would obtain those images.


Yet the iTunes .rsrc file weighs in at more than 10MB.  What's in it?


* I'll take this opportunity to make another prediction about Apple: 
one of the next major changes to the OS seems likely to be migrating 
away from HSF to the same file system used by Unix/Linux.  The downside 
to this migration is the final end of the old resource forks, but the 
upside would be complete compatibility with most of the non-Microsoft 
world while further marginalizing Windows, drawing attention to it being 
a technological island.


Similar in scope to the other major transitions (68k->PPC, Classic->OS 
X, PPC->Intel) this will be somewhat disruptive during the transitional 
phase, but will also carry an upside for vendors as the previous 
transitions did by artificially enhancing demand for software upgrades 
which would otherwise be dependent on features alone.


I'll go further out on a limb to predict this will be announced within 
the next three years.


--
 Richard Gaskin
 Fourth World
 Revolution training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-22 Thread Dave


On 21 Jan 2009, at 16:09, Richard Gaskin wrote:


Dave wrote:

I tried the getResource command in revolution, it doesn't seem to   
work with Mac OS X .rsrc files. For instance when I run this  
script  from a button:

on mouseUp
   local myFilePathName
   local myResourceData
   local myResult
   put "/Users/Dave/Desktop/iTunesImages/myFile.rsrc" into   
myFilePathName

   put getResources(myFilePathName) into myResourceData
   put the result into myResult
end mouseUp
myResourceData and myResult are both empty, yet when I look at  
the  file with ThemePark it show the Icons and Files ok. The  
myFile.rsrc I  used here was taken from iTunes in the Resources  
folder inside the  App Package.

What I really want is to convert the pngs and icns into JPEG images.


The getResources function works on the resource fork only, added  
back in the OS 8.5 days and increasingly Apple is migrating away  
from using resource forks so it's not so useful under OS X.*


So while that explains why you're not getting what you're looking  
for with that, I'm confused about what's in iTunes .rsrc file.  It  
seems its icons are stored in  several dozen .icns files within the  
bundle's "Resources" folder.  With a tool or external that can  
extract the image data from them (could conceivably be done with a  
script too) it would seem those icns files are where you would  
obtain those images.


Yet the iTunes .rsrc file weighs in at more than 10MB.  What's in it?


There are a *lot* of icons! Download ThemePark and look. For instance  
there is an Icon for every iPod on the market in every color, when  
you include all resolutions from 512x512 (in some cases) down plus  
all the masks. There are also png images and a lot of strings. I just  
want to be able to access this rsrc file to get an icns file, then  
access the icns file to get the rendered version of the Icon at a  
given resolution.


* I'll take this opportunity to make another prediction about  
Apple: one of the next major changes to the OS seems likely to be  
migrating away from HSF to the same file system used by Unix/ 
Linux.  The downside to this migration is the final end of the old  
resource forks, but the upside would be complete compatibility with  
most of the non-Microsoft world while further marginalizing  
Windows, drawing attention to it being a technological island.


Similar in scope to the other major transitions (68k->PPC, Classic- 
>OS X, PPC->Intel) this will be somewhat disruptive during the  
transitional phase, but will also carry an upside for vendors as  
the previous transitions did by artificially enhancing demand for  
software upgrades which would otherwise be dependent on features  
alone.


I'll go further out on a limb to predict this will be announced  
within the next three years.




I wouldn't be surprised if they did do this. Seems like they are hell- 
bent on getting rid of anything good from the Mac OS. The last time I  
looked HFS was a much better filing system than the Unix filesystem.


Thanks a lot
All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-22 Thread Luis

Hiya,

I believe the next filesystem will be ZFS. Support for it is already  
included, although buggy and incomplete (don't know on the Server).


Cheers,

Luis.





I wouldn't be surprised if they did do this. Seems like they are  
hell-bent on getting rid of anything good from the Mac OS. The last  
time I looked HFS was a much better filing system than the Unix  
filesystem.


Thanks a lot
All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-22 Thread Dave

Hi,

This looks good! Check out;

http://blogs.zdnet.com/storage/?p=335

All the Best
Dave

On 22 Jan 2009, at 12:01, Luis wrote:


Hiya,

I believe the next filesystem will be ZFS. Support for it is  
already included, although buggy and incomplete (don't know on the  
Server).


Cheers,

Luis.





I wouldn't be surprised if they did do this. Seems like they are  
hell-bent on getting rid of anything good from the Mac OS. The  
last time I looked HFS was a much better filing system than the  
Unix filesystem.


Thanks a lot
All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-22 Thread J. Landman Gay

Dave wrote:

I just want to be 
able to access this rsrc file to get an icns file, then access the icns 
file to get the rendered version of the Icon at a given resolution.


If it is just a one-time thing to extract particular icons, you could 
save a lot of time by just using Graphic Converter. It will extract all 
the icons for you and save them to disk.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-22 Thread Dave


On 22 Jan 2009, at 16:18, J. Landman Gay wrote:


Dave wrote:

I just want to be able to access this rsrc file to get an icns  
file, then access the icns file to get the rendered version of the  
Icon at a given resolution.


If it is just a one-time thing to extract particular icons, you  
could save a lot of time by just using Graphic Converter. It will  
extract all the icons for you and save them to disk.


GC will open .icns files, but not MacOS X .rsrc files, so I'd still  
need a way to get the .icns resources into separate files.


But , no, unfortunately I want to be able to obtain the rendered icon  
from a .icns file and this file is stored on a removable volume. When  
the volume is mounted, I want to be able to grab the icon from the  
file on the volume.


Is there really no way to access MacOS X .rsrc (theme) files under  
RunRev or a way get an Icon and a rendered image?


All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-22 Thread stephen barncard
Have you opened (control-click) the package and looked through all the
files/folders inside? .rsrc is a special os type that's actually a
folder.
-- An example is the .rtfd 'file' that is created by saving an RTF
document with graphics in TextEdit.   In that case, it was really just
a folder with a .png and a .rtf file inside. This is what Apple came
up with when they had to move their 'Resource Fork' metaphor to a
different file system.
I quite like the OSX packaging system of today (making a Rev
standalone inside a package with splash - I have it all, a stand alone
for the client but an easily modified system with all the source code
and tools), but in the pre-rev Hypercard world, resource forks were a
godsend. That's where the XCMDS, sounds, pictures, code, fonts,
everything except data was stored, which of course was in the DATA
fork. I used many, many, TEXT resources like we use custom properties
in Rev today. You could even put executable Hypertalk into these
resources. This was a system thing; and other apps could get access to
the same resources.
This is not the same now in Rev as pictures and sounds are stored in a
proprietary format, I'm sure to preserve cross-platform compatibility.
Say, nobody's written a 'Resource Mover' for Rev yet.
maybe I will.
sqb
2009/1/22 Dave 
>
> On 22 Jan 2009, at 16:18, J. Landman Gay wrote:
>
>> Dave wrote:
>>
>>> I just want to be able to access this rsrc file to get an icns file, then 
>>> access the icns file to get the rendered version of the Icon at a given 
>>> resolution.
>>
>> If it is just a one-time thing to extract particular icons, you could save a 
>> lot of time by just using Graphic Converter. It will extract all the icons 
>> for you and save them to disk.
>
> GC will open .icns files, but not MacOS X .rsrc files, so I'd still need a 
> way to get the .icns resources into separate files.
>
> But , no, unfortunately I want to be able to obtain the rendered icon from a 
> .icns file and this file is stored on a removable volume. When the volume is 
> mounted, I want to be able to grab the icon from the file on the volume.
>
> Is there really no way to access MacOS X .rsrc (theme) files under RunRev or 
> a way get an Icon and a rendered image?
>
> All the Best
> Dave
>
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution



--
Stephen Barncard
-
San Francisco
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-22 Thread Richard Gaskin

stephen barncard wrote:

Have you opened (control-click) the package and looked through all the
files/folders inside? .rsrc is a special os type that's actually a
folder.


I'm not so sure.  Right-clicking on iTunes.rsrc doesn't provide an 
option for opening it as a bundle, and dropping it on TextEdit open it 
up.  It appears to be a file, and if indeed it contains icons it's just 
another example of Apple not following their own guidelines, which 
suggest that icons should be put in icns files within the app's bundle.



This is not the same now in Rev as pictures and sounds are stored in a
proprietary format, I'm sure to preserve cross-platform compatibility.
Say, nobody's written a 'Resource Mover' for Rev yet.
maybe I will.


If you can pull the image data from icns files and .rsrc files into Rev 
image objects, be sure to put a PayPal link on your download page and 
let me know the URL as soon as it's available. :)


--
 Richard Gaskin
 Fourth World
 Revolution training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-22 Thread stephen barncard
Wow... strange it appears Apple is violating its own guidelines to
obfuscate resources -- a form of DRM. Where can one get a iTunes.rsrc
file? It doesn't appear to be in my distribution.

2009/1/22 Richard Gaskin :
> stephen barncard wrote:
>>
>> Have you opened (control-click) the package and looked through all the
>> files/folders inside? .rsrc is a special os type that's actually a
>> folder.
>
> I'm not so sure.  Right-clicking on iTunes.rsrc doesn't provide an option
> for opening it as a bundle, and dropping it on TextEdit open it up.  It
> appears to be a file, and if indeed it contains icons it's just another
> example of Apple not following their own guidelines, which suggest that

>  Richard Gaskin

-- 
Stephen Barncard
-
San Francisco
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-22 Thread Richard Gaskin

stephen barncard wrote:
> Where can one get a iTunes.rsrc file?

iTunes.app/Contents/Resources/iTunes.rsrc

--
 Richard Gaskin
 Fourth World
 Revolution training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-23 Thread Dave

Hi,

I control-clicked the file and it doesn't seem to be a package, it  
looks like a regular file. If I open it with ThemePark, I can see the  
contents.


All the Best
Dave


On 22 Jan 2009, at 19:16, stephen barncard wrote:


Have you opened (control-click) the package and looked through all the
files/folders inside? .rsrc is a special os type that's actually a
folder.
-- An example is the .rtfd 'file' that is created by saving an RTF
document with graphics in TextEdit.   In that case, it was really just
a folder with a .png and a .rtf file inside. This is what Apple came
up with when they had to move their 'Resource Fork' metaphor to a
different file system.
I quite like the OSX packaging system of today (making a Rev
standalone inside a package with splash - I have it all, a stand alone
for the client but an easily modified system with all the source code
and tools), but in the pre-rev Hypercard world, resource forks were a
godsend. That's where the XCMDS, sounds, pictures, code, fonts,
everything except data was stored, which of course was in the DATA
fork. I used many, many, TEXT resources like we use custom properties
in Rev today. You could even put executable Hypertalk into these
resources. This was a system thing; and other apps could get access to
the same resources.
This is not the same now in Rev as pictures and sounds are stored in a
proprietary format, I'm sure to preserve cross-platform compatibility.
Say, nobody's written a 'Resource Mover' for Rev yet.
maybe I will.
sqb
2009/1/22 Dave 


On 22 Jan 2009, at 16:18, J. Landman Gay wrote:


Dave wrote:

I just want to be able to access this rsrc file to get an icns  
file, then access the icns file to get the rendered version of  
the Icon at a given resolution.


If it is just a one-time thing to extract particular icons, you  
could save a lot of time by just using Graphic Converter. It will  
extract all the icons for you and save them to disk.


GC will open .icns files, but not MacOS X .rsrc files, so I'd  
still need a way to get the .icns resources into separate files.


But , no, unfortunately I want to be able to obtain the rendered  
icon from a .icns file and this file is stored on a removable  
volume. When the volume is mounted, I want to be able to grab the  
icon from the file on the volume.


Is there really no way to access MacOS X .rsrc (theme) files under  
RunRev or a way get an Icon and a rendered image?


All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution




--
Stephen Barncard
-
San Francisco
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting Resources from MacOS X Resource Files

2009-01-23 Thread Dave

Hi,

Don't forget iTunes runs on Windows too, it's probably to make it  
compatible with the Windows version?


All the Best
Dave

On 22 Jan 2009, at 19:58, stephen barncard wrote:


Wow... strange it appears Apple is violating its own guidelines to
obfuscate resources -- a form of DRM. Where can one get a iTunes.rsrc
file? It doesn't appear to be in my distribution.

2009/1/22 Richard Gaskin :

stephen barncard wrote:


Have you opened (control-click) the package and looked through  
all the

files/folders inside? .rsrc is a special os type that's actually a
folder.


I'm not so sure.  Right-clicking on iTunes.rsrc doesn't provide an  
option
for opening it as a bundle, and dropping it on TextEdit open it  
up.  It
appears to be a file, and if indeed it contains icons it's just  
another
example of Apple not following their own guidelines, which suggest  
that



 Richard Gaskin


--
Stephen Barncard
-
San Francisco
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution