Create shortcut to folder on desktop if it not exist

Hi all

I am looking for a way to only create a shortcut to a folder if it not exist on my desktop.
Until now I am only able to delete every alias file on my desktop first to be sure there is one shortcut. (I am the problem )

And must we use Finder or Shell, what is the correct way

Thanks for reading

What I really love to have is that I can place a folder in the Finder Favorites list with script.

Hi Ron,

When you say ‘What I’d really love to have is that I can place a folder in the Finder Favorites list with script’, is this the sort of thing?

http://www.mavericks-add-to-finder-sidebar.com

Here is how you would do something in the shell to create a symbolic link.

set theFile to "/Users/<user>/Documents/testfile.txt"
set theLink to "/Users/<user>/Desktop/link to testfile.txt"

do shell script "[[ -L " & quoted form of theLink & " ]] || ln -s " & quoted form of theFile & space & quoted form of theLink

The script above assumes that the file exists is a symbolic link. That means that it will fail if there is any other kind of file with the exact same name. The test -e doesn’t work with symbolic links.

Thanks both for your reply, much appreciated.

I check it out tomorrow because I must go now.

Will reply this weekend

Hi guys,
I was just thinking of a similar problem. Is there a way to programmatically install a shortcut into the finder toolbar? This would be to assist in the installation of scripts for people who are not familiar with Finder toolbar shortcuts.
Regards,
David

Hi all

I used the script from DJ on a new example page on my site.
Not funny that we need the new applescripttask function to use it but that’s something we must deal with in VBA Office.

http://www.rondebruin.nl/mac/mac035.htm

Thanks and have a nice weekend