My Simple But Broken AppleScrpit

I am working on an applescript that moves an item into a folder… A simple operation but for some reason I keep getting errors when at the movement. (Currently only one of the buttons is coded as I am trying to bugfix)


set thePath to ((get path to startup disk) & "Users:" & ¬
	(do shell script "echo $USER")) as string
set targetjar to thePath & "Library:Application Support:minecraft:bin" as string
display dialog "Pick Jar" buttons {"RegularMods", "Visual", "HaClient"} default button 3
set the button_pressed to the button returned of the result
if the button_pressed is "Regular Mods" then
	-- action for 1st button goes here
else if the button_pressed is "Visual" then
	-- action for 2nd button goes here
else
	display dialog "Pick jar" buttons {"Nodus", "Nyan"} default button 2
	if the button returned of the result is "Nodus" then
		-- action for 1st button goes here
	else
		set Nyan to thePath & ":Desktop:minecraft:Mods:Nyan:nyan.jar" as string
		tell application "Finder"
			duplicate file of Nyan to targetjar
		end tell
	end if
end if
display dialog targetjar buttons {"OK"} default button 1
display dialog Nyan buttons {"OK"} default button 1

Hi,

the problem is the composed path targetjar, between the user folder and “Library” must be a colon,
this is a version with built-in relative paths


set targetjar to (path to application support folder from user domain as text) & "minecraft:bin:"
set Nyan to (path to desktop as text) & "minecraft:Mods:Nyan:nyan.jar"

set {button returned:button_pressed} to display dialog "Pick Jar" buttons {"RegularMods", "Visual", "HaClient"} default button 3

if the button_pressed is "Regular Mods" then
	-- action for 1st button goes here
else if the button_pressed is "Visual" then
	-- action for 2nd button goes here
else
	display dialog "Pick jar" buttons {"Nodus", "Nyan"} default button 2
	if the button returned of the result is "Nodus" then
		-- action for 1st button goes here
	else
		tell application "Finder"
			duplicate file Nyan to folder targetjar
		end tell
	end if
end if
display dialog targetjar buttons {"OK"} default button 1
display dialog Nyan buttons {"OK"} default button 1


Thanks!