Help Cleaning Up

Ok thanks previously for everyones help. Ive gotten it to do exactly what I want, but now I wanna clean it up a little. Smooth the edges so to speak.


tell application "System Events" to set visible of processes whose name begins with "Choose Thy Fate" to true
tell application "Finder"
	if not (exists file "Inferno.jpg") then my downloadImage("http://cognitivedistortion.com/img/FG85/3D/68_Inferno-Wide.jpg", "Inferno.jpg")
	if not (exists file "Heaven.jpg") then my downloadImage("http://www.72seconds.com/mt/archives/Busting%20into%20Heaven%20-%20(c)%20Rod%20Boothby%202005.jpg", "Heaven.jpg")
	if not (exists file "Megadeath.mp3") then my downloadImage("http://www.megadeth.com/gow/gears_of_war.mp3", "Megadeath.mp3")
	if not (exists file "Choir.mp3") then my downloadImage("http://www.grkat.nfo.sk/hudba/sl08.mp3", "Choir.mp3")
	
	if button returned of (display dialog "Choose Wisely." buttons ["Life", "Death"] default button 2) is "Death" then
		activate application "iTunes"
		open file "Megadeath.mp3"
		tell application "System Events" to set visible of processes whose name begins with "iTunes" to false
		delay 1
		open file "Inferno.jpg"
		tell application "System Events" to set visible of processes whose name begins with "Finder" to true
		if button returned of (display dialog "You Have Chosen Poorly" buttons ["I Recant", "Good"]) is "I Recant" then
			quit application "Preview"
			try
				tell application "iTunes"
					if player state is playing and current track's name contains "gears_of_war" then
						stop
					end if
				end tell
			end try
			
			display dialog "You Are Forgiven." buttons ["Here Is Thy Due Reward"] default button 1
			activate application "iTunes"
			open file "Choir.mp3"
			tell application "System Events" to set visible of processes whose name begins with "iTunes" to false
			delay 1
			open file "Heaven.jpg"
			
		else
			shut down
		end if
	else
		display dialog "You Have Choosen Wisely." buttons ["Here Is Thy Due Reward"] default button 1
		activate application "iTunes"
		open file "Choir.mp3"
		tell application "System Events" to set visible of processes whose name begins with "iTunes" to false
		delay 1
		open file "Heaven.jpg"
		
	end if
end tell

on downloadImage(_url, _name)
	tell application "URL Access Scripting" to download _url to file ((path to desktop as string) & _name) replacing yes
end downloadImage

Ok so when you open the app, I need to to hide all other windows.

I dont want iTunes to show at all.

And I want the pictures to take up the whole screen, with a black background. Or just have Preview be maximized, to fit the full screen. Whichever is more plausible

I also want to turn iTunes volume on automically.

I appreciate any help, thank.

Include those images and sounds with your script/app, instead of downloading them and leaving them on the desktop.

You should consider using one of these instead:
http://microcosmsoftware.com/playsound/
http://www.steike.com/code/playsound/

If not one of those, then at least use QuickTime Player; That way you’re not messing with the volume in iTunes.

Not going to happen with regular AppleScript.

Preview isn’t scriptable, nor does it have a full screen option.