Desktop tidy alias problem

Hi

I am trying to move all files and folders to a Bin Later folder in my home and then create an alias to Bin later on the Desktop. I have this so far but the problem is now every time i run the script the alias gets moved as well. Does anyone know when moving folders if it is possible to exclude the alias on the desktop called Bin Later?

I have problems with the alias “Bin Later” on the Desktop it fine when it first runs but when i try it again i keep getting an error to say the finder got an error because there is already an item with that name

tell application "Finder"
	set myhome to path to home folder as alias
	set mydesktop to path to desktop folder as alias
	set thename to "Bin Later"
	if not (exists folder "Bin Later" in myhome) then
		make new folder at myhome with properties {name:"Bin Later"}
	end if
	set everyfile to every file in mydesktop
	set everyfolder to every folder in mydesktop
	set BinLateralias to folder "Bin Later" in myhome as alias
	
	if not (exists BinLateralias in mydesktop) then make new alias to BinLateralias at mydesktop with properties {name:"Bin Later"}
	move everyfile to folder "Bin Later" in myhome
	move everyfolder to folder "Bin Later" in myhome
	
	if (exists BinLateralias in folder "Bin Later" in myhome) then delete alias "Bin Later" in folder BinLateralias
	
end tell

I am basically trying to mod Adam Goldsteins script in Applescript the missing manual but guess what moving all folders on the desktop doesn’t work cheers Adam!

tell application "Finder"
	if not (the folder "oldDesktop" of home exists) then
		make new folder at home with properties {name:"oldDesktop"}
	end if
	
	move every file of the desktop to the folder "oldDesktop" of home
	move every folder in the desktop to the folder "oldDesktop" of home
end tell

I gave up with this alias thing and i am attaching a folder action script to my desktop. It forces me to keep my Desktop clean :slight_smile:

on adding folder items to theFolder after receiving theItems
	
	repeat with currentItem in theItems
		tell application "Finder"
			if not (exists folder "Bin Later" in home) then
				make new folder at home with properties {name:"Bin Later"}
			end if
			if the name of the currentItem is not ".DS_Store" then
				move currentItem to folder "Bin Later" of home
			end if
		end tell
	end repeat
end adding folder items to