Associates the projector to a filetype. The other scripts allow the movie to test if they were opened with teh save file, and reads and writes the save data.
--Code by Chuck Neal
--Chuck@mediamacros.coc
on createSaveAssociation Extension, ProgramPath, FileType, Description
set shortFileName = baShortFileName(ProgramPath)
baWriteIni( "Extensions", Extension, shortFileName && "^." & Extension, "win.ini" )
baSendMsg( 65535, 26, 0, 0, true )
if the number of chars in Extension <= 3 then
baWriteRegString("." & Extension, "", FileType, "HKEY_CLASSES_ROOT" )
baWriteRegString( FileType & "ShellOpenCommand", "", shortFileName && "%1", "HKEY_CLASSES_ROOT" )
baWriteRegString( FileType, "", Description, "HKEY_CLASSES_ROOT" )
end if
end
on checkFileOpen keyList, key
set fileName = baCommandArgs( )
set partFile = char 2 to the number of chars in filename of filename
set driveLetter = baFindDrive( "a", partFile )
if fileName <> "" then
set stringList = getFileData (driveLetter & fileName, keyList, key)
return stringList
else
return void
end if
end
on saveFile fileName, keyList, valueList, extension, key
repeat with x = 1 to count(keyList)
baWriteIni("SaveData", getAt(keyList, x), baEncryptText(getAt(valueList,x), key), fileName & extension)
end repeat
end
on getFileData whatFile, keyList, key
set valueList = []
repeat with x = 1 to count(keyList)
set value = baDecryptText(baReadIni( "SaveData", getAt(keyList, x), "Error", whatFile),key)
add valueList, value
end repeat
return valueList
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA