--@Script: Xlib.UtilityLib --@Author Luke --@Version 1.0.0 --@Description -- Just some useful utility scripts for authoring on Splat(thing) -- shows some info about the thing case (thing) of #casts, "casts": XShowCasts() #members, "members": XShowPaths() otherwise XShowCasts() XShowPaths() end case end on XShowCasts () -- puts a table showing the file paths for all the attached casts out = "" longestName = 4 repeat with i = 1 to (the number of castlibs) n = string(castlib(i).name) longestName = max(longestName, n.length) end repeat formatStr1 = "%-2s" FormatStr2 ="%-"&(longestName+2)&"s" put return & "Casts attached to " & the movieName & "'" & return after out put "---------------------------------" & return after out put sprintf(formatStr1,"#") && sprintf(FormatStr2,"Name") && "Path" & return after out put "---------------------------------" & return after out repeat with i = 1 to (the number of castlibs) n = sprintf(formatStr1,string(i)) m = sprintf(FormatStr2,string(castlib(i).name)) put n && m && string(castlib(i).filename) & return after out end repeat put "---------------------------------" & return after out put out end on XShowPaths () -- puts a table showing the file paths for all the linked members out = "" longestMName = 4 longestFName = 4 repeat with i = 1 to (the number of castlibs) repeat with j = 1 to (the number of members of castlib i) f = string(member(j,i).filename) if (f <> "") then longestMName = max(longestMName, string(member(j,i)).length) longestFName = MAX(longestFName, F.length) end if end repeat end repeat FormatStrCNum = "%-4s" FormatStrMNum = "%-6s" FormatStrName ="%-"&(longestMName+2)&"s" TotalLength = 12+longestMName+1+longestFName hr = sprintf( "%'--"&TotalLength &"s", "--") put return & "External Members " & the movieName & "'" & return after out put hr & return after out put sprintf(FormatStrCNum,"Cast") && sprintf(FormatStrMNum,"Member") && sprintf(FormatStrName,"Name") && "Path" & return after out put hr & return after out repeat with i = 1 to (the number of castlibs) repeat with j = 1 to (the number of members of castlib i) f = string(member(j,i).filename) if (f <> "") then c = sprintf(FormatStrCNum,string(i)) m = sprintf(FormatStrMNum,string(i)) n = sprintf(FormatStrName, string(member(j,i).name)) put c&& m && n && f & return after out end if end repeat end repeat put hr & return after out put out end --$EXPORTED ON 23/11/08 at 12:56 PM