Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Installer Help. AppleScript gurus?

Installer Help. AppleScript gurus?
Thread Tools
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 22, 2001, 09:52 PM
 
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.

[This message has been edited by Synotic (edited 04-22-2001).]
     
Synotic  (op)
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 22, 2001, 09:59 PM
 
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


     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:09 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2