#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" ResourceCopier on showError pType switch pType case sourceFile answer "Please open a source file." break case destFile answer "Please open a destination file." break case copyRes answer "Please select a resource to copy." break case delRes answer "Please select a resource to delete." break default answer "Unknown error - please check your settings and try again." end switch exit to top end showError 4 c r* ResourceCopier U Lucida Grande U Verdana @U Verdana cREVGeneral scriptChecksum V@n$B debugObjects bookmarks handlerList showErrortempScript prevHandler scriptSelection char 440 to 439script <
on showError pType
switch pType
case sourceFile
answer "Please open a source file."
break
case destFile
answer "Please open a destination file."
break
case copyRes
answer "Please select a resource to copy."
break
case delRes
answer "Please select a resource to delete."
break
default
answer "Unknown error - please check your settings and try again."
end switch
exit to top
end showError
@ * Open Source Ep on mouseUp answer file "Select a file containing the resources you want to copy:" put it into sourceFile if sourceFile is empty then exit mouseUp put sourceFile into fld "Source" put getResources(sourceFile) into fld "SourceRes" end mouseUp _ R cREVGeneral scriptChecksum M7X|frevUniqueID 1056662404386 bookmarks handlerList mouseUptempScript prevHandler scriptSelection char 242 to 241script 5on mouseUp
answer file "Select a file containing the resources you want to copy:"
put it into sourceFile
if sourceFile is empty then exit mouseUp
put sourceFile into fld "Source"
put getResources(sourceFile) into fld "SourceRes"
end mouseUp
Source ` @ " cREVGeneral revUniqueID 1056663307816 SourceRes )` @ cREVGeneral revUniqueID 1056663317384 ` A Open Dest Ep on mouseUp answer file "Select a file containing resources:" put it into destFile if destFile is empty then exit mouseUp put destFile into fld "Dest" put getResources(destFile) into fld "DestRes" end mouseUp L_ R cREVGeneral scriptChecksum X"7sEi bookmarks revUniqueID 1056663424854handlerList mouseUpscriptSelection char 162 to 209prevHandler mouseUptempScript scripton mouseUp
answer file "Select a file containing resources:"
put it into destFile
if destFile is empty then exit mouseUp
put destFile into fld "Dest"
put getResources(destFile) into fld "DestRes"
end mouseUp
Dest ` @8 " cREVGeneral revUniqueID 1056663424690 DestRes )` 8 @ cREVGeneral revUniqueID 1056663424728 ` A Clear Source Ep Won mouseUp put empty into fld "Source" put empty into fld "SourceRes" end mouseUp _ R cREVGeneral scriptChecksum /O-_D:[E.revUniqueID 1056663521210 bookmarks handlerList mouseUptempScript prevHandler scriptSelection char 74 to 73script qon mouseUp
put empty into fld "Source"
put empty into fld "SourceRes"
end mouseUp
Clear Dest Ep Son mouseUp put empty into fld "Dest" put empty into fld "DestRes" end mouseUp _ R cREVGeneral scriptChecksum zƑ[+}D>- bookmarks revUniqueID 1056663559395handlerList mouseUpscriptSelection char 82 to 81prevHandler mouseUptempScript script mon mouseUp
put empty into fld "Dest"
put empty into fld "DestRes"
end mouseUp
Copy Gpon mouseUp put fld "Source" into sourceFile if sourceFile is empty then showError "sourceFile" put fld "Dest" into destFile if destFile is empty then showError "destFile" put the selectedText of fld "SourceRes" into tRes if tRes is empty then showError "copyRes" put item 1 of tRes into tResType put item 2 of tRes into tResID get copyResource(sourceFile, destFile, tResType, tResID) if the result is not empty then answer the result put getResources(destFile) into fld "DestRes" end mouseUp h 0 . p cREVGeneral scriptChecksum +)=za%XӥHChandlerList mouseUpbreakPoints scriptSelection char 282 to 281revUniqueID 1056663580930 bookmarks tempScript prevHandler mouseUpscripton mouseUp
put fld "Source" into sourceFile
if sourceFile is empty then showError "sourceFile"
put fld "Dest" into destFile
if destFile is empty then showError "destFile"
put the selectedText of fld "SourceRes" into tRes
if tRes is empty then showError "copyRes"
put item 1 of tRes into tResType
put item 2 of tRes into tResID
get copyResource(sourceFile, destFile, tResType, tResID)
if the result is not empty then answer the result
put getResources(destFile) into fld "DestRes"
end mouseUp
Field 1 cREVGeneral revUniqueID 1056664227667 Source Field 1 8 cREVGeneral revUniqueID 1056664240752 Destination Delete Gp=on mouseUp put fld "Dest" into destFile if destFile is empty then showError destFile put the selectedText of fld "DestRes" into tRes if tRes is empty then showError delRes put item 1 of tRes into tResType put item 2 of tRes into tResID answer "Really delete resource ID " & tResID & " from the destination file?" \ with "Cancel" or "Delete" if it is "Cancel" then exit mouseUp get deleteResource(destFile, tResType, tResID) if the result is not empty then answer the result put getResources(destFile) into fld "DestRes" end mouseUp 0 6 V cREVGeneral scriptChecksum iP-3@breakPoints handlerList mouseUpscriptSelection char 181 to 180 bookmarks revUniqueID 1056664284856prevHandler mouseUptempScript scripton mouseUp
put fld "Dest" into destFile
if destFile is empty then showError destFile
put the selectedText of fld "DestRes" into tRes
if tRes is empty then showError delRes
put item 1 of tRes into tResType
put item 2 of tRes into tResID
answer "Really delete resource ID " & tResID & " from the destination file?" \
with "Cancel" or "Delete"
if it is "Cancel" then exit mouseUp
get deleteResource(destFile, tResType, tResID)
if the result is not empty then answer the result
put getResources(destFile) into fld "DestRes"
end mouseUp
Help Cp Yon mouseUp set the visible of fld "Help" to not the visible of fld "Help" end mouseUp V 0 ( 4W cREVGeneral scriptChecksum 冲Yԗ}handlerList mouseUpbreakPoints scriptSelection char 88 to 87revUniqueID 1057446741675 bookmarks tempScript prevHandler mouseUpscripton mouseUp
set the visible of fld "Help" to not the visible of fld "Help"
end mouseUp
Help !p on linkClicked pLink if pLink contains "@" then revGoURL "mailto:" & pLink else revGoURL pLink end if end linkClicked on mouseUp hide me end mouseUp @ @ cREVGeneral scriptChecksum ADHn >,M bookmarks revUniqueID 1057446930182handlerList linkClicked mouseUpscriptSelection char 166 to 165prevHandler tempScript scripton linkClicked pLink
if pLink contains "@" then
revGoURL "mailto:" & pLink
else
revGoURL pLink
end if
end linkClicked
on mouseUp
hide me
end mouseUp
EThis is a simple utility stack similar to HyperCard's ResourceMover. Revolution 1.1.1 allowed resources to be imported, listed and deleted, but this seems to have been removed from Rev 2's application Browser (or at least hidden). Select a source file (any file type can be used) and all it's internal resources (icons, sounds, XCMDs, XFCNs etc) will be displayed. Then select a destination file - probably your Revolution stack but you can use anything. It's resources will also be displayed. ^Select a resource in the source file and click 'Copy' to place it into your destination file. ^If you want to delete any resources from your destination file, select it and click 'Delete'. - This has only been tested on Mac OS X 10.2.6 and Rev 2.0.1, but should work fine on any Mac system. Other operating systems don't use resource forks, so this is of no interest. k- Messing around with resources can cause problems, so make backup copies of all files before trying this. h- Feel free to use or modify this stack in any way, but anything you do with it is your responsibility. 7Sarah Reichelt sarah@troz.net http://www.troz.net/Rev/ ` >