home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Stickerpedia Stickerbook
/
Stickerbook.iso
/
pc
/
DATA
/
shared.cxt
/
00001_Script_1
next >
Wrap
Text File
|
2003-03-24
|
3KB
|
191 lines
--¨
main
--¨
main
global oHQ
global oSpr
global oMarvin
global oFileIO
global gDataScreenMode
global gPlatForm
global gCDPath
global gPathDelim
global gPasswordDinos
global gPasswordAnimals
global gPasswordOceans
global gCastLibs
global gWhichCD
global gDontReact
global gImageList
global gImageMode
on initApp
cursor 4
register xtra "PrintOMatic", "PMAT156-312-16871"
if the runmode = "author" then
the windowlist = []
the actorlist = []
the searchPath = []
the itemdelimiter = ","
end if
if the platform starts "Win" then
gPathDelim = "\"
else
gPathDelim = ":"
end if
oMarvin = new(script "oMarvin")
oFileIO = new(script "oFileIO")
--oHQ = new(script "oHQ")
oSpr = new(script "oSpr")
(the searchPath).add(the pathname)
gPasswordDinos = "reptile"
gPasswordAnimals = "tiger"
gPasswordOceans = "shark"
gDontReact = 0
-- doImagemanagement
setImageList
gImageMode = #inCast -- other option is #looseOnCD
gWhichCD = getPreferences()
--put "gWhichCD" && gWhichCD
cursor -1
end
on setPreferences
-- prefString = baencryptText(gWhichCD, "goilheimer")
--
-- if gPathDelim = "\" then
-- baWriteRegString( "stickerbook", "stickerbook", prefString , "HKEY_CLASSES_ROOT" )
-- else
-- sysFolder = basysfolder("prefs")
-- writeFile oFileIO, sysFolder, "stickerbook", prefString
-- end if
end
on getPreferences
if gPathDelim = "\" then
prefString = baReadRegString( "stickerbook", "stickerbook", "error","HKEY_CLASSES_ROOT" )
else
sysFolder = basysfolder("prefs")
prefString = getFile (oFileIO, sysFolder, "stickerbook")
end if
if stringP(prefString) then retVal = badecryptText(prefString, "goilheimer")
if not ( (retVal = "oceans") or (retVal = "dinos") or (retVal = "animals") ) then
retVal = "error"
end if
return retVal
end
on doImagemanagement
gImageList = []
if gPathDelim = "\" then
-- create lists for the separate directories:
oceanlist = baFileList( the pathname & "images" & gPathDelim & "animals", "*.jpg" )
animalList = baFileList( the pathname & "images" & gPathDelim & "oceans", "*.jpg" )
dinoList = baFileList( the pathname & "images" & gPathDelim & "dinos", "*.jpg" )
end if
-- put the first list into the global container
gImageList = duplicate(oceanlist)
-- add the other two lists to it:
repeat with n in animalList
append gImageList, n
end repeat
repeat with n in dinoList
append gImageList, n
end repeat
sort gImageList
-- create imagelist without jpg extensions
newImageList = []
repeat with n in gImageList
repeat with i = 1 to 4
delete n.char[(n.length)]
end repeat
newImageList.add(n)
end repeat
put newImageList
put newImageList.count
-- check they are all jpegs:
-- repeat with n in gImageList
-- if n contains "jpg" then
-- next repeat
-- else
-- alert "Whoops" && n
-- exit
-- end if
-- end repeat
end