storing data in Windows doesn't work
Posted: Tue Dec 25, 2007 12:40 am
Help!!
I cut pieces of Richard Gaskin's Employee Data Base to get these scripts they work fine in OSX but in XP and Vista the files don't show when I try to import them after saving. If I can remember the name of the file it will import it. Thanks for any suggestions! Here are the scripts:
on mouseUp
doEditExport
end mouseUp
on doEditExport
ask file "Please name the file:" with "Exported Data"
if it is empty then exit to top
put it into filePathToSave
put field "name" of card cFresh & tab \
& field "date" of card cFresh & tab \
& field "batch" of card cFresh & tab \
& field "weight" of card cFresh & tab \
& field "alcohol" of card cFresh & tab \
& field "water" of card cFresh & tab \
& field "fredry" of card cFresh & return after dataToExport
put dataToExport into URL ("file:" & filePathToSave)
end doEditExport
on mouseUp
doEditImport
end mouseUp
on doEditImport
if the platform is "MacOS" then
answer file "Choose a tab-delimited text file to import:" of type "TEXT"
else if the platform is "Win32" then
answer file "Choose a tab-delimited text file to import:" \
with filter "Text File" & return & "*.txt"
answer file "Choose a tab-delimited text file to import:"
end if
if it is empty then exit to top
put URL ("file:" & it) into fileData
put the itemdelimiter into savedDelimiter
set the itemdelimiter to tab
lock messages
lock screen
repeat for each line thisRecord in fileData
if thisRecord is empty then next repeat
put item 1 of thisRecord into field "name"
put item 2 of thisRecord into field "date"
put item 3 of thisRecord into field "batch"
put item 4 of thisRecord into field "weight"
put item 5 of thisRecord into field "alcohol"
put item 6 of thisRecord into field "water"
put item 7 of thisRecord into field "fredry"
unlock messages
unlock screen
end repeat
end doEditImport
I cut pieces of Richard Gaskin's Employee Data Base to get these scripts they work fine in OSX but in XP and Vista the files don't show when I try to import them after saving. If I can remember the name of the file it will import it. Thanks for any suggestions! Here are the scripts:
on mouseUp
doEditExport
end mouseUp
on doEditExport
ask file "Please name the file:" with "Exported Data"
if it is empty then exit to top
put it into filePathToSave
put field "name" of card cFresh & tab \
& field "date" of card cFresh & tab \
& field "batch" of card cFresh & tab \
& field "weight" of card cFresh & tab \
& field "alcohol" of card cFresh & tab \
& field "water" of card cFresh & tab \
& field "fredry" of card cFresh & return after dataToExport
put dataToExport into URL ("file:" & filePathToSave)
end doEditExport
on mouseUp
doEditImport
end mouseUp
on doEditImport
if the platform is "MacOS" then
answer file "Choose a tab-delimited text file to import:" of type "TEXT"
else if the platform is "Win32" then
answer file "Choose a tab-delimited text file to import:" \
with filter "Text File" & return & "*.txt"
answer file "Choose a tab-delimited text file to import:"
end if
if it is empty then exit to top
put URL ("file:" & it) into fileData
put the itemdelimiter into savedDelimiter
set the itemdelimiter to tab
lock messages
lock screen
repeat for each line thisRecord in fileData
if thisRecord is empty then next repeat
put item 1 of thisRecord into field "name"
put item 2 of thisRecord into field "date"
put item 3 of thisRecord into field "batch"
put item 4 of thisRecord into field "weight"
put item 5 of thisRecord into field "alcohol"
put item 6 of thisRecord into field "water"
put item 7 of thisRecord into field "fredry"
unlock messages
unlock screen
end repeat
end doEditImport