Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

1theo0

macrumors member
Original poster
Jul 21, 2012
32
0
There's an annoying launcher for Harry Potter and the Chamber of Secrets, so I wanted to make a script that includes the whole game, and when clicked, opens the app. It never works, no matter what I do! Help me please. I attach here the zipped app.
Here are my attempts:

1.

set applocation to POSIX path of ":Contents:Resources:Harry Potter II:Harry Potter CoS"
try
set command to "open" & quoted form of applocation
do shell script command
end try

2.

set applocation to POSIX path of ":Contents:Resources:Harry Potter II:Harry Potter CoS"
try
set command to "open as alias" & quoted form of applocation
do shell script command
end try

3.

set applocation to POSIX path of "Contents:Resources:Harry Potter II:Harry Potter CoS"
do shell script "open " & applocation

4.

open ":Contents:Resources:Harry Potter II:Harry Potter CoS"
 

Attachments

  • Harry Potter CoS.zip
    772.1 KB · Views: 88
Last edited:
Hooray!

Ha! I figured it out.
I share it here, in case anyone else needs it. To use it, just drop your Harry Potter II folder from the installation disc into the Contents/Resources folder :D. I also made a mod so you don't need the cd to play the game- a small image containing a file the game checks for in order to run! You have 3 minutes to load the game before the image unmounts itself! Enjoy!

The code:
Code:
set image to (path to me as string) & "Contents:Resources:HP2.dmg"
set HP2Volume to "HP2"
set pathtoapp to (path to me as string) & "Contents:Resources:Harry Potter II"
do shell script "hdiutil mount" & space & quoted form of POSIX path of image
tell application "Finder"
	activate
	open application file "Harry Potter CoS" of folder pathtoapp
end tell
delay 180
tell application "Finder"
	eject HP2Volume
end tell

PS. I made the icon, it looks a bit weird, sorry!
 

Attachments

  • Harry Potter 2.zip
    261.1 KB · Views: 95
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.