OK. I have an issue that really stumps me, and I could use some help. Picture this:
Two Machines. One at home. One at office.
Home machine is Intel machine running Snow Leopard (10.6.4).
Office machine is PPC G5 machine running Leopard (10.5.8)
I run the IDENTICAL code on each (below).
When I write the file from office and read it from office, no problem.
When I write the file from home and read it from home, no problem.
When I write the file from office and read it from home, no problem.
HOWEVER, when I write the file from home and read from office. I get an error.
Seems the data files should be identical, but they are apparently not.
The error I get at office while reading the file created at home is: Can’t get pName of {|pName|:“Created At Home”}.
Note that when the home machine saves the record and that data is read at the office the label has a vertical bar on each side of it. Vertical bar is not present with data files created at office. Is this a difference between Leopard and Snow Leopard somehow? Any ideas on fixing this problem are appreciated.
–Script starts here
set ourRawData to {pName:“Created At Home”} --Simple Record for test purposes. Actual record has many properties.
display dialog “What do you want to do?” buttons {“Read”, “Write”}
set ourResult to button returned of result
if ourResult is “Read” then
set theData to ReadLatestData()
display dialog pName of theData
else if ourResult is “Write” then
WriteLatestData(ourRawData)
end if
–***************************************************
on WriteLatestData(LatestData) --Write a datafile called “LatestData” that is stored in application. “LatestData” will contain the current “LatestData” array
set fileName to (path to desktop folder as Unicode text) & “LatestData”
set outFile to open for access fileName with write permission
write LatestData as record to outFile
close access outFile
end WriteLatestData
–***************************************************
on ReadLatestData() --Read a datafile called “LatestData” to be stored in application. “LatestData” contains last used information
set fileName to (path to desktop folder as Unicode text) & “LatestData”
set ourFile to open for access fileName
set LatestDataFromFile to read ourFile as record
close access ourFile
return LatestDataFromFile
end ReadLatestData
–***************************************************