I have to agree bash is the way to go here, Applescript file handling is ... odd. That said, though, sometimes you want to handle files in an odd, esoteric, way. So, to get your script to compile (maybe function, I dunno) you would first want to translate from posix notation by changing "set this folder to ..." to "set this folder to posix file ... " You can run that as a script by itself to see what the result is. Assuming that translates well, finder might accept it, might not, you just have to fiddle with it. It might need to also have an "... as alias" tacked on the end
( ... )
I don't know if Automator can handle if statements, can it? That's why I was attempting to do it via AppleScript as opposed to Automator (I actually basically understand how to use Automator, as opposed to being a complete newbie with AppleScript).
Ah, they told me they were going to add those. Looks like they just added variables and loops in my copy, no conditionals to be found, just filters. Well, you can still put them in by using the AppleScript action, but at that point it's more trouble than it's worth.
So, have we sorted your script yet? (haven't read the comments above)
tell application "Finder" get the home as alias as text set thisFolder to the result & "Dropbox:Minecraft:minecraft:bin:" as alias if the name of thisFolder's folders contains "minecraft-mods.jar" then set the name of folder "minecraft.jar" of thisFolder to "minecraft-original.jar" set the name of folder "minecraft-mods.jar" of thisFolder to "minecraft.jar" else set the name of folder "minecraft.jar" of thisFolder to "minecraft-mods.jar" set the name of folder "minecraft-original.jar" of thisFolder to "minecraft.jar" end if end tell
Comments 19
Reply
https://files.me.com/kioarthurdane/sdekbg
Reply
Reply
I posted my response on applescript for exactly the reason they said on their cross-post that there was virtually no activity over here.
Reply
Reply
Reply
So, have we sorted your script yet? (haven't read the comments above)
Reply
get the home as alias as text
set thisFolder to the result & "Dropbox:Minecraft:minecraft:bin:" as alias
if the name of thisFolder's folders contains "minecraft-mods.jar" then
set the name of folder "minecraft.jar" of thisFolder to "minecraft-original.jar"
set the name of folder "minecraft-mods.jar" of thisFolder to "minecraft.jar"
else
set the name of folder "minecraft.jar" of thisFolder to "minecraft-mods.jar"
set the name of folder "minecraft-original.jar" of thisFolder to "minecraft.jar"
end if
end tell
Reply
Leave a comment