Originally posted by Synotic:
tell application "Finder"
activate
set theFileToRead to open for access file "Extras.rsrc" in ":Desktop Folder:Titanium Theme:"
set theContents to read theFileToRead as data
close access theFileToRead
set theFileToWrite to open for access file "Extras.rsrc" in ":System:Library:Frameworks:Carbon.framework:Versi ons:A:Frameworks:HIToolbox.framework:Versions:A:Re sources:"
write theContents to theFileToWrite
close access theFileToWrite
end tell
I can't get this to work. If you can't see what I am trying to do, I am trying to:
Read a file,
write the contents of the file it read to another file,
display a dialog with some text and a button saying "Okay"
Any help is appreciated.
Update: I got the dialog working:
tell application "Finder"
activate
set theFileToRead to open for access file "Extras.rsrc" in "

esktop Folder:Titanium Theme:"
set theContents to read theFileToRead as data
close access theFileToRead
set theFileToWrite to open for access file "Extras.rsrc" in ":System:Library:Frameworks:Carbon.framework:Versi ons:A:Frameworks:HIToolbox.framework:Versions:A:Re sources:"
write theContents to theFileToWrite
close access theFileToWrite
end tell
set variableName to display dialog "Congratulations! You have installed the titanium theme for Mac OS X. Now just boot into OS X and check out the theme." buttons {"Cool."} default button "Cool."
set anotherVariableName to button returned of variableName
if anotherVariableName = "Cool." then
stop
else
stop
end if