jacque wrote:There's no point in removing it, it will just get recreated. It changes constantly. Most document files keep information like this, if you've ever opened a Word file in a text editor you'll see similar things. The IDE relies on the info, and since none of it is included in a standalone, it does no harm.
Thanks Jacque for the response, much appreciated. I get your point.
There may be some reason anyway to remove that stuff (removing it is after all one of the things the standalone builder does!), e.g.:
- you work with multiple people on a project and don't want IDE symbols (e.g. someone else's breakpoints) lying around
- you use a diff tool and don't want changes in the IDE symbols to show up as differences
- you converted a very old project to the most recent LC and suspect many custom property sets contain unused properties, or even cause bugs
- you want to reduce the size of your .livecode files
- you are like me and like things clean
For what it''s worth to others, I found the way to clean up IDE symbols before saving a stack:
I traced the clean-up code in the Standalone builder to revsaveasstandalone.livecodescript
I made copies of revSetStackProps and revSetObjectProps and put them in one of my own libraries
Added code to delete a whole lot of other useless custom property sets and custom properties
Added code to clean up substacks as well (the Standalone Builder forgets to do this apparently!)
Added a saveStackRequest handler to activate the cleanup code: (you put this in the script for every stack)
Code: Select all
on saveStackRequest
mySetStackProps the long id of me
pass saveStackRequest
end saveStackRequest
on mySetStackProps pStack
local tCard,tControl,tSetTo,tRemoveAll,tIncludeList,tCardNum,tControlNum,tSubStacks
local tStandaloneSettingsA
lock screen
lock messages
set the wholeMatches to true
--remove profiles from all objects
put the customProperties["cRevStandaloneSettings"] of stack (the mainstack of stack pStack) into tStandaloneSettingsA
if tStandaloneSettingsA["setToProfile"] is not "" then put true into tSetTo
-- stack properties
set the customKeys["cREVStandaloneSettings"] of stack pStack to ""
mySetObjectProps the long id of stack pStack,tSetTo,tStandaloneSettingsA["includeProfiles"],tStandaloneSettingsA
-- card properties
put the number of cds in stack pStack into tCardNum
repeat with tCard = 1 to tCardNum
mySetObjectProps the long id of cd tCard of stack pStack,tSetTo,tStandaloneSettingsA["includeProfiles"],tStandaloneSettingsA
-- control properties
put the number of controls of cd tCard of stack pStack into tControlNum
repeat with tControl = 1 to tControlNum
mySetObjectProps the long id of control tControl of cd tCard of stack pStack,tSetTo,tStandaloneSettingsA["includeProfiles"],tControl,tStandaloneSettingsA
end repeat
end repeat
put the substacks of pStack into tSubStacks
repeat for each line tSS in tSubStacks
get the long id of stack (tSS) of stack pStack
mySetStackProps it
end repeat
unlock screen
end mySetStackProps
on mySetObjectProps pObject,pSetTo,pIncludeList,pStandaloneSettingsA
local tKeys,tProfileSets,tLine,tFinalList
put the customProperties["cREVGeneral"] of pObject into tKeys
if pSetTo then put pStandaloneSettingsA["setToProfile"] into tKeys["profile"]
if pIncludeList = "" then
delete local tKeys["profile"]
delete local tKeys["masterName"]
delete local tKeys["profileList"]
end if
if pIncludeList is not "*" then
--only include specific profiles in pObject
put the customPropertySets of pObject into tProfileSets
put tProfileSets into tFinalList
repeat for each line tLine in tProfileSets
-- delete unlisted propsets with names that begin with "cREVDiverged"
if char 1 to 12 of tLine is "cREVDiverged" then
delete char 1 to 12 of tLine
if tLine is not among the lines of pStandaloneSettingsA["includeProfiles"] then
delete line lineOffset(("cREVDiverged"&tLine),tFinalList) of tFinalList
end if
else if tLine is among the items of "uRIP,cConsNo,cConsLast,cGlxGeneral,cGlx2General,cREVGeometryCache,cREVGeometryCacheIDs,cREVTable" then
-- delete other common propsets
delete line lineOffset(tLine,tFinalList) of tFinalList
end if
end repeat
set the customPropertySets of pObject to tFinalList
end if
-- delete common props from the cREVGeneral propset
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"]
delete local tKeys["AlreadyHidden"]
delete local tKeys["breakPoints"]
delete local tKeys["breakpointconditions"]
delete local tKeys["breakpointstates"]
delete local tKeys["debugObjects"]
delete local tKeys["scalefactor"]
delete local tKeys["scripteditorselection"]
delete local tKeys["scripteditorvscroll"]
delete local tKeys["revUniqueID"]
if pSetTo then unlock messages --activate profile libraries
set the customProperties["cREVGeneral"] of pObject to tKeys
if pSetTo then lock messages --activate profile libraries
end mySetObjectProps