I am not sure if the behavior I’ve been seeing with a script is a bug, known problem or if I’m doing something stupid. The script shown at the end of this post works with "use framework “Foundation” " commented out. If I uncomment the line I get an error that displays the message, “An error of type -1409 has occurred.” -1409 is the error errFSForkNotFound which means the named fork doesn’t exists. This doesn’t make a lot of sense.
This runs the same way in SD and Script Editor. I am wondering if there is a way to to leave in the use framework “Foundation” line and still be able to use the “write” scripting addition. I know I can use ASObj-C to write the file but I am trying to minimize the ASObj-C. This is part of a script that gets weather info from the weather sensor in my back yard and is like to be updated and used a lot. ASObj-C is harder to work with when developing a solution in that I can’t run it in SD and switching editors makes it a lot harder. So far I only used ASObj-C 3 times to download the weather data to my Mac and it is not crashing a lot with just that while using SD for developing the script.
I am guessing when "use framework “Foundation” " is used something is compiled and/or run differently in Script Debugger.
use scripting additions
-- use framework "Foundation"
set PathToFolder to "Bills second iMac HD:Users:bill:Desktop:Test:"
set WeatherDataFileName to "TestFile.txt"
set TheText to "Test"
tell application "Finder" to make new file at PathToFolder with properties {name:WeatherDataFileName}
set TheText to "Test"
write TheText to file (PathToFolder & WeatherDataFileName)
Bill Kopp