?

Log in

Finder renaming script? - applescript [entries|archive|friends|userinfo]
applescript

[ website | Apple's AppleScript Home Page ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Finder renaming script? [Jun. 17th, 2011|01:36 pm]
applescript

applescript

[johncoxon]
Hey all.

Before I tell you the script I'm trying to use I want to give you guys an idea of what I'm trying to achieve with it. I'm an avid Minecraft player, and the game places a folder in Application Support called Minecraft. In this folder is a file: /bin/minecraft.jar. In order to mod the game, you rename the file to minecraft-original.jar, unzip and then put new files in the resulting minecraft.jar folder. In order to bring back your vanilla Minecraft installation, you rename the folder minecraft.jar to minecraft-mods.jar, and the file called minecraft-original.jar is renamed minecraft.jar.

What I am attempting to do is create an AppleScript that looks to see whether the folder minecraft-mods.jar exists, and if it does, go back to the vanilla build, but if it doesn't, go to the modded build. My proposed script is below:

tell application "Finder"
set thisFolder to "/Users/John/Dropbox/Minecraft/minecraft/bin"
if folder "minecraft-mods.jar" of thisFolder exists then
set file "minecraft.jar" of thisFolder as "minecraft-original.jar"
set folder "minecraft-mods.jar" of thisFolder as "minecraft.jar"
else
set folder "minecraft.jar" of thisFolder as "minecraft-mods.jar"
set file "minecraft-original.jar" of thisFolder as "minecraft.jar"
end if
end tell

I get the error, "Expected class name but found """." What am I doing wrong?
link

Comments:
[User Picture]From: kiodane
2011-06-17 04:04 pm (UTC)
Ugh, some of those lines got wrapped... I'm not on my computer and it looks like the formatting got a tad messed up.

https://files.me.com/kioarthurdane/sdekbg
(Replies frozen) (Parent) (Thread)
[User Picture]From: xv
2011-06-17 04:07 pm (UTC)
Hey dude. :)
(Replies frozen) (Parent) (Thread)
[User Picture]From: kiodane
2011-06-17 05:41 pm (UTC)
Long time no see, my brotha'

I posted my response on applescript for exactly the reason they said on their cross-post that there was virtually no activity over here.
(Replies frozen) (Parent) (Thread)