[Rezilla-commits] RezillaExtras/ToggleFork/ToggleFork_Extras/Aida ToggleForkHelp.aida, NONE, 1.1
Brought to you by:
bdesgraupes
From: Bernard D. <bde...@us...> - 2006-11-28 16:19:24
|
Update of /cvsroot/rezilla/RezillaExtras/ToggleFork/ToggleFork_Extras/Aida In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12911 Added Files: ToggleForkHelp.aida Log Message: First checkin --- NEW FILE: ToggleForkHelp.aida --- :Title: ToggleForkHelp :DestFolder: ../Help :Project: Rezilla :Author: Bernard Desgraupes :Email: bde...@us... :Homepage: http://perso.orange.fr/bdesgraupes/ :Created: 2006-11-28 14:14:23 :Modified: 2006-11-28 14:14:23 :Keywords: resource, fork ((s1 What is it about? Traditionally, Macintosh files have always been constituted of two forks: the data fork and the resource fork. This latter contains all kinds of resources, which are data in a predefined format used by the application while it is running (icons, menus, strings etc.) or by the system itself. The main draw back of this model is that, when a Macintosh file is copied to another system, it generally looses its resource fork and most of the time it becomes unusable. Since system 9, for the sake of portability of software to other operating systems, Apple has introduced the notion of resources stored in the data fork of a file rather than in the resource fork. Bundled applications, for instance, can thus store their resources in separate files contained in the bundle. ((b ToggleFork b)) is a simple drag and drop tool which lets you transfer the resources from a fork to the other. If you have an editor (like ResEdit) which is ((i not i)) able to edit resources contained in the datafork of a file, you can use ToggleFork to get a file having the same resources in its resource fork and view or edit them. The converse is true: you can prepare your resources with a traditional editor in the resource fork of a file and get a datafork resource file using ToggleFork. ((s1 How does it work? Just drag a file over the icon of ((b ToggleFork b)): ((lu ((li if it is a traditional file with both a data fork and a resource fork, its resource fork will be rewritten in the data fork of a separate file called by default ((i Out.datafork i)). The original file is unmodified. ((li if it is a file containing resources in its datafork, all its resources will be copied to the resource fork of a separate file called by default ((i Out.rsrcfork i)). The original file is unmodified. ((li if the file has no resource, nothing happens. lu)) ((b ToggleFork b)) is a background only application which immediately quits after it has done its job. You should normally not even see it in the Dock. ((s1 Download ((b ToggleFork b)) can be found on ((lk http://perso.orange.fr/bdesgraupes/tools.html )) my web page lk)). Click to ((lk http://perso.orange.fr/bdesgraupes/Downloads/ToggleFork.hqx )) download ToggleFork lk)) You need Stuffit Expander to unpack it. ((s1 Scriptability ((b ToggleFork b)) is scriptable so you can drive it with ((b AppleScript b)). The terminolgy contains a single term: ToggleFork with an optional parameter ((i to i)) which lets you specify the name of the output file instead of the default names mentioned above. ((| tell application "ToggleFork" ToggleFork "HD:folder:subfolder:somefile" as alias end tell |)) or ((| tell application "ToggleFork" ToggleFork "HD:folder:subfolder:somefile" as alias to "the_new_name" end tell |)) Here is ToggleFork's dictionary as reported by AppleScript Editor: ((| ToggleFork: Exchange resource forks (data fork resources become resource fork resources and vice versa) ToggleFork alias -- the input file [to string] -- name of the output file Quit: Quit the application Quit |)) ((s1 AppleEvents If you want to use AppleEvents directly, the ((i ToggleFork i)) term is attached to the ((i aevt/odoc i)) event. The optional parameter has code 'name'. For instance, if you use the text editor ((lk http://alphatcl.sourceforge.net/wiki )) ((i Alpha i)) lk)) (which has a ((lk http://wiki.tcl.tk/ )) Tcl lk)) interpreter), you would write, in a Tcl script or in Alpha's Tcl shell, something like: ((| set filename "HD:folder:subfolder:somefile" AEBuild -r 'TgFk' aevt odoc ---- [tclAE::build::alis $filename] |)) or ((| AEBuild -r 'TgFk' aevt odoc ---- [tclAE::build::alis $filename] \ name [tclAE::build::TEXT "some_new_name"] |)) ((s1 Why ToggleFork? OK, I know, one can open a Terminal window in OSX and type commands like this: ((| touch SomeApp-rsrcfork.rsrc cp SomeApp.rsrc SomeApp-rsrcfork.rsrc/rsrc rm SomeApp.rsrc mv SomeApp-rsrcfork.rsrc SomeApp.rsrc |)) So why should you use ToggleFork? Well, matter of taste: instead of typing command line instructions, all you have to do is drag and drop your file on the icon of ToggleFork. And ToggleFork is scriptable, which is great for script lovers. ((s1 Known problems This tool is designed for Mac OS X 10.2 or greater. Please ((lk mailto:bde...@us... )) email me lk)) any problem you encounter with this software: ((nl Author: Bernard Desgraupes ((nlWeb: http://perso.orange.fr/bdesgraupes/tools.html ((s1 Version history ((lu ((li 1.0 -- 2003-04-27 -- First release. ((li 1.1 -- 2003-05-25 -- Bug fix (in copy of attributes). ((li 1.1.1 -- 2006-11-28 -- Switched to packaged application. lu)) ((s1 Licence and disclaimer This software is free software and distributed under the terms of the new BSD license: ((lu ((li Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ((li Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. ((li Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. ((li Neither the name of Bernard Desgraupes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. lu)) This software is provided by the copyright holders and contributors ((i as is i)) and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the regents or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. (c) Copyright: Bernard Desgraupes, 2003-((s [clock format [clock seconds] -format "%Y"] s)) All rights reserved. ((- ((nl Last updated ((s [ISOTime::ISODateAndTimeRelaxed] s)) |