#!/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 "$@" revAltCleanStack3Oon openStack end openStack on preOpenStack put "" into fld "custProps" put "pre altClean:" into fld "PreSize" put "post altClean:" into fld "PostSize" end preOpenStack on resizeStack end resizeStack on closeStack end closeStack on doIt #answer "put your plugin script in the doIt handler of the stack script!" end doIt H]altMsg

AltClean existing stack?

**stack**

Note: this will replace the existing stack with a new 'AltCleaned' version of itself.

It is generally a good idea to perform this action on a copy of a stack

altFinishMsg

You saved: **K** K

This represents a **%** % savings!

AltCleanStack] Utahoma Ums sans serif UtahomaWms sans serif Wms sans serif Wms sans serifWTahomaUTahoma UTahoma Wtahoma Wtahoma cREVGeneral debugObjectscREVGeometryCachestackID1023 Pa--> YOU CAN COPY AND PASTE THIS WHOLE SCRIPT INTO A STACK IF YOU WISH --> THEN JUST CALL: altCleanStack --> THIS IS HANDY FOR A STRIP-AND-SHIP ROUTINE local lCustomPropList on altCleanStack pStack lock messages put the short name of pStack into tTestForRevStack if char 1 to 3 of tTestForRevStack is "rev" then beep answer warning "You cannont AltClean a REV IDE stack!!" if the shiftKey is not down then exit to top end if if exists(fld "CustProps") then put "AltCleaning..." into fld "CustProps" put the effective filename of pStack into tPath put altFileSize(tPath) into tPreSize put pStack into tStackList put cr & the substacks of pStack after tStackList repeat for each line l in tStackList put the long name of stack l into tStack2 cleanRevGeneralPropSets tStack2 if the hilite of btn "clearGM" then cleanRevGeometrySets tStack2 put the number of cds of tStack2 into tCdNum repeat with x = 1 to tCdNum put "cd" && x && "of" && tStack2 into tObj cleanRevGeneralPropSets tObj if the hilite of btn "clearGM" then cleanRevGeometrySets tObj put the number of controls of cd x of tStack2 into tCtrlNum repeat with y = 1 to tCtrlNum put "control" && y && "of cd" && x && "of" && tStack2 into tObj cleanRevGeneralPropSets tObj if the hilite of btn "clearGM" then cleanRevGeometrySets tObj end repeat end repeat end repeat compact pStack save pStack put altFileSize(tPath) into tPostSize if exists(fld "preSize") then put "pre AltClean: " & tPreSize & " bytes" into fld "preSize" if exists(fld "postSize") then put "post AltClean: " & tPostSize & " bytes" into fld "postSize" put round((tPreSize-tPostSize)/1024) into tKsaved put round(100-(tPostSize*100/tPreSize)) into tPercentSaved put the altFinishMsg of this stack into tMsg if tMsg is not empty then replace "**K**" with tKsaved in tMsg replace "**%**" with tPercentSaved in tMsg answer information tMsg else --> THIS HANDLER BEING CALLED OUTSIDE OF THE PLUGIN answer information "Saved: " & tKsaved && "K" & cr & "Percentage saved: " & tPercentSaved && "%" end if if exists(fld "CustProps") then put cr & lCustomPropList after fld "CustProps" put cr & cr & "pre AltClean: " & tPreSize & " bytes" after fld "CustProps" put cr & "post AltClean: " & tPostSize & " bytes" after fld "CustProps" put cr & "Saved: " & tKsaved & " K" after fld "CustProps" put cr & "Percent Reduced: " & tPercentSaved & " %" after fld "CustProps" set the vScroll of fld "CustProps" to 50000 end if unlock messages end altCleanStack on cleanRevGeometrySets pObj get the customPropertySets of pObj set the wholeMatches to true delete line lineOffset("cREVGeometry",it) of it delete line lineOffset("cREVGeometryCache",it) of it delete line lineOffset("cREVGeometryCacheIDs",it) of it set the customPropertySets of pObj to it end cleanRevGeometrySets on cleanRevGeneralPropSets pObj put the customProperties["cREVGeneral"] of pObj into tKeys delete local tKeys["bookmarks"] delete local tKeys["handlerList"] delete local tKeys["scriptSelection"] delete local tKeys["prevHandler"] delete local tKeys["tempScript"] delete local tKeys["script"] delete local tKeys["scriptCheckSum"] set the customProperties["cREVGeneral"] of pObj to tKeys end cleanRevGeneralPropSets function altFileSize pPath if there is a file pPath then put the defaultFolder into tOldDF if pPath contains "/" then --need to set the defaultFolder get matchText(pPath,"(.*\/)",tFolderPath) -- gets the folderpath get matchText(pPath,".*\/(.*?)$",pPath) -- gets the file name replace space with "+" in pPath -- fixes for spaces set the defaultFolder to tFolderPath end if put the detailed files into tList set the defaultFolder to tOldDF put lineOffset(cr&pPath&",",cr&tList) into tLineNum return (item 2 of line tLineNum of tList) else return "Error: File does not exist: " & pPath end if end altFileSize ] cREVGeneralcREVGeometrycacheordertotal12cREVGeometryCacheIDs 107899366083610151078221181004100410790333375641003107822217510110111078223409576101410790753527881009107822118100710061078993723796101610782224836451012107822118108510081079425512602102310782218001881010  description  7on linkClicked pLink revGoURL pLink end linkClicked RV2 cREVGeneral revUniqueID 1078221181004 cREVGeometry Master,expectedRect108,10,376,108Master,scalebottomDistanceMaster,movevDistancefalseMaster,movehDistancefalseMastertrueMaster,scaleRightAbsolutetrueMaster,scaleRighttrueMaster,scalerightDistance-48Master,scaleRightObjectRefcardMaster,scaleRightObjectSideRightMaster,cardRanking1Master,scaleleftDistanceMaster,scaletopDistance AltCleanStack  TO USE: OPEN STACK TO CLEAN  @   PRESS CLEAN STACK BUTTON @  TOPSTACK (AND SUBSTACKS) @ ARE CLEANED @ NNote: This will not work on password protected stacks. Un protect them first. This plugin allows you to remove custom Rev properties in order to reduce the filesize of stacks which are not to be included in standalones. The distribution builder automatically does these things for standalones. 'Answers to Frequently Asked Questions: What does this really do?   Rev creates a custom property set called cREVGeneral for each stack, card and control. This set contains property values used by the IDE. When a developer builds a standalone, parts of this property set are systematically removed as the standalone no longer needs access to most of them. One of the properties in cREVGeneral is "the script" and it contains the htmlText of the script for that object. This is done so that users who choose to colorize their scripts, can quickly access them later. The size for this property is greater than the actual script size, so if you have a stack with many lines of code, this property can increase your stack size. -Can I still edit my stack in the RunRev IDE?  , Certainly! If you altClean your stack and remove the cREVGeneral prop sets, you can still edit you stack and run it in the IDE as you normally would. Rev will just add the cREVGeneral to any control you edit -- eventually growing the stack in size until it is back where you started. ZIf the Distribution Builder already deletes the cREVGeneral prop set, then why do I care?  Y LSome people distribute stacks outside of the standalone. These stacks don't need the cREVGeneral prop set and can be reduced in size significantly. In my case, I use a splash screen standalone which downloads the latest version of a stack from the web. The size of the stack on the web is reduced condsiderably by 'altCleaning' it. TWill altClean remove any other RunRev custom prop sets which may effect my project?  S No, it doesn not affect other custom prop sets or other profiles. The Geometry Manager and other RunRev features sitll work as planned. 2Why did it take you so long to write this plugin?  1 Actually, I first learned of this issue while talking with Richard Gaskin and Geoff Canyon at the Revolution Conference in San Francisco MacWorld. Then Monte Goulding filled me in on exactly how to clean a stack. Thanks to all of them, this plugin is now freely available. As usual with any of our plugins, please back up your stacks! I use altPluginArchive to do this. It also makes a serialized copy of a stack each time it is invoked. Chipp Walters  Altuit, inc   `& T altPlug.pngD5 altVersv0.98altOpenVisibletruealtPlugFileNamerevAltCleanStack.rev altOnClickMedoIt altUpdateURLx]N'gfX9~ [הi}!`{+ d\b)luV?6}uGjgV/35_|ɧaǟc坃dxi2AUTr#t &6[YT=i<b U5;uBF<8fAV#7;Gk٩3@>o0^Bds9oEm@[ǾHͬo3c($[^~k u8s 6:vړ{NhY]EX[N.I@QPuZ(͝|cVm(X3+kLIA/@ܔ=!w=EGx^/hA?E{q4<1Kd 2jɱnYy`έ~ n.^`sм0ڽ H_F ((?$=|ߝcΩ}bW=C'Wwrvۍ,hA_]ink}o%-UIF_)M+ E#[kM\9ի0&$ A6yG&Zr?Y_qb>FQ5k~7YWÙcq X{YrZAUThW'e䦵90 QqEṗ("PMiM fq^]R+a ɫj\(mDYcP,J hRqO1l*`b"xT-^Rl& P,aC4!/:҉Q$ZQuD#b-*Cv ńV;*·JH&Lslh=TQa!!c C% ahC`_Y b|z}HIENDB` cREVGeneral revUniqueID 1078221181007 cREVGeometry Master,expectedRect 394,6,426,38Master,scalebottomDistanceMaster,movevDistancefalseMaster,movehDistance-24Master,moveHObjectSiderightMastertrueMaster,scalerightDistanceMaster,moveHObjectRefcardMaster,cardRanking1Master,scaleleftDistanceMaster,moveHAbsolutetrueMaster,scaletopDistance Master,moveHtruetogglePaletteModeA*on mouseUp if the mode of this stack is 1 then palette this stack else toplevel this stack end if end mouseUp @ cREVGeneral revUniqueID 1078221181085  Clean StackGX3on mouseUp put the topStack into tStack put the effective filename of the topStack into tPath put the altMsg of this stack into tMsg replace "**stack**" with tPath in tMsg answer information tMsg with "Cancel" or "OK" if it is "Cancel" then exit to top answer information "Save Stack First?" with "Cancel" or "OK" if it is "OK" then save stack the topStack end if altCleanStack tStack end mouseUp on mouseEnter set the showBorder of me to true end mouseEnter on mouseLeave set the showBorder of me to false end mouseLeave @J> cREVGeneral revUniqueID 1079075352788 gear_information.pngV PNG  IHDR szz*tEXtCreation TimeDo 7 Aug 2003 19:35:53 +0100ketIME  pHYs  d_gAMA a IDATxڥW{lS?׾~v1&f&!e (hZѦXC?][ V!تv*-c dJINlu}wν桭eڕ{9w0 ؏_={hzg߾7O>yP}y{'XVsmA4W OLVknvt#ϸ\};,Ntw78 ` ]\9G7n|v>^FK.m25U|<&? 0$ >d(,}35??GkMwnH A2@}@SJ d @غje?QQ'Ss_xr6< PyP, Ȁ@\ޯIfaxR,4m* Y2?8yw]*ЎJ"# ƑHB 5H鷪 "LZ\/B2YJǚ5mܼ$FST~Lčf]o7 pa(@g]*ƪakj@Eb`a&3@,Y `p*~@R22` VBɔЈAV&-tU;1gɥ*>k&'pغqFr p_ÍmwݭXD^R57˨1ΝKiQ  lz6jbӧ7 9CRwZѱ\HIHz=D/@::õuz;l gB8TҐ`f{9#߫Da2 xd300PK&ߞ'y0tNMir[\sZ4:IU+ [S,PiUˍfB̜޼ys駟4<{uB:MW'&4-}\J8l6xhj+ |S |>Ɏ 6[:f!&RZٹv}ի#C r;{=V81 Js@}8 A΀чѢꎎ β&,8LM/$,+\{^;SκTӧwTM{VphҧӁ?Q>Ug$b{ʱcjkiFp\zz:$f%̻Ffr׫5@0U1vl\΍^'Dhp +d -2.P0NO~_6ntm(Ԁ*Dn,i8:]wudH. rY 0F3O/uI5ka1/s=5-uBFZV:6n#E\M9'QV(Ut p9TDu:#zAqB*8Lՠ9AΕ -B"'9%)OJ/5QF[ ٞ6h4+S xj%67_/j::Z:?ШW+)(QUg[B@IENDB` cREVGeneral revUniqueID 1078221800188 PreSize f cREVGeneral revUniqueID 1078222175101 pre AltClean: 20296 bytes  CustProps)`|Q. cREVGeometryMaster,scaleBottomObjectSideBottomMaster,movehDistancefalseMastertrueMaster,scaleBottomObjectRefcardMaster,scaleBottomAbsolutetrueMaster,scaleBottomtrueMaster,expectedRect 6,124,428,310Master,scalebottomDistance-15Master,movevDistancefalseMaster,scaleRightAbsolutetrueMaster,scaleRighttrueMaster,scalerightDistance-6Master,scaleRightObjectRefcardMaster,scaleRightObjectSideRightMaster,cardRanking2Master,scaleleftDistanceMaster,scaletopDistance cREVGeneral revUniqueID 1078222483645  AltCleaning... pre AltClean: 20296 bytes post AltClean: 20311 bytes Saved: -0 K Percent Reduced: -0 % `F},  PostSize f cREVGeometry Master,expectedRect342,102,416,123Master,scalebottomDistanceMaster,movevDistancefalseMaster,movehDistance-89Master,moveHObjectSiderightMastertrueMaster,scalerightDistanceMaster,moveHObjectRefcardMaster,cardRanking1Master,scaleleftDistanceMaster,moveHAbsolutetrueMaster,scaletopDistance Master,moveHtrue cREVGeneral revUniqueID 1078223409576 post AltClean: 20311 bytes drag.gif P*local lMoving, lDistance on mouseDown put true into lMoving put the right of this stack - item 1 of the screenMouseloc,the bottom of this stack - item 2 of the screenMouseLoc into lDistance end mouseDown on mouseUp put false into lMoving unlock cursor end mouseUp on mouseRelease put false into lMoving unlock Cursor end mouseRelease on mouseMove if lMoving then put item 1 to 2 of the rect of this stack,item 1 of the screenMouseloc+item 1 of lDistance,item 2 of the screenMouseloc+item 2 of lDistance into tRect if item 3 of tRect < (the minWidth of this stack+the left of this stack) then put (the minWidth of this stack+the left of this stack) into item 3 of tRect if item 4 of tRect < (the minHeight of this stack+the top of this stack) then put (the minHeight of this stack+the top of this stack) into item 4 of tRect if item 3 of tRect > (the maxWidth of this stack+the left of this stack) then put (the maxWidth of this stack+the left of this stack) into item 3 of tRect if item 4 of tRect > (the maxHeight of this stack+the top of this stack) then put (the maxHeight of this stack+the top of this stack) into item 4 of tRect lock screen set the rect of this stack to tRect set the bottomRight of me to the width of this stack, the height of this stack revUpdateGeometry unlock screen end if end mouseMove on mouseEnter if the platform is not "MacOS" then lock cursor set cursor to the cWinCursor of me end if end mouseEnter on mouseLeave put false into lMoving unlock cursor end mouseLeave N  cWinCursor1016^GIF89a !, #ܾ&F,\ATS])gGIKjo*; cREVGeometryMaster,moveVObjectSidebottomMaster,movehDistance-8MastertrueMaster,moveVObjectRefcardMaster,moveHObjectRefcardMaster,moveVAbsolutetrue Master,moveVtrueMaster,expectedRect334,181,348,194Master,scalebottomDistanceMaster,movevDistance-9Master,moveHObjectSiderightMaster,scalerightDistanceMaster,cardRanking2Master,scaleleftDistanceMaster,moveHAbsolutetrueMaster,scaletopDistance Master,moveHtrue cREVGeneral revUniqueID 1078993660836DS0200308@ABDJUb@U)!A6><84"@">A ~|P~ wcw??  cREVGeneral revUniqueID 1078993723796 vers on mouseUp if the shiftKey is down then ask "New Version:" with me if it is empty then exit mouseUp put it into me set the altVers of img "altPlug.png" to it end if end mouseUp 2*$ cREVGeometry Master,movevDistancefalseMaster,scalebottomDistanceMaster,expectedRect 306,42,342,62Master,movehDistance-25Master,moveHObjectSiderightMastertrueMaster,scalerightDistanceMaster,moveHObjectRefcardMaster,cardRanking1Master,scaletopDistanceMaster,moveHAbsolutetrueMaster,scaleleftDistance Master,moveHtrue cREVGeneral revUniqueID 1079033337564 v0.98clearGM`e|clear cREVGeometry cREVGeneral revUniqueID 1079425512602