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
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.
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
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.