I am trying to make a little script to make modding Minecraft a little easier. But for some reason some of the characters in the commands in the strings are being garbled. Instead of “rm META-INF/MOJANG_C." Keystroke will type "mr META-INF/MOJANG_c.”
Is there anything wrong with this code? Why is this doing this?
property McTmpPath : missing value
tell application "Terminal"
activate
do script
end tell
set theCommands to {¬
"cd ~", ¬
"mkdir MCTMP", ¬
"cd MCTMP", ¬
"jar xf ~/Library/Application\\ Support/minecraft/bin/minecraft.jar", ¬
"PAUSE", ¬
"rm META-INF/MOJANG_C.*", ¬
"jar uf ~/Library/Application\\ Support/minecraft/bin/minecraft.jar ./", ¬
"cd ..", ¬
"rm -rf MCTMP"}
repeat with i in theCommands
set TheCommand to i as text
if TheCommand is "PAUSE" then
tell application "Finder"
set McTmpPath to ((path to home folder as text) & "MCTMP" as alias)
open McTmpPath
end tell
tell me to activate
display dialog "Copy MOD class files into the MCTMP directory.
Then click 'Continue' to finish MOD installation." buttons {"Continue"}
else
tell application "Terminal" to activate
delay 0.75
tell application "System Events" to keystroke TheCommand
delay 1
tell application "System Events" to keystroke return
end if
end repeat