I want to put an alias to a fixed folder, namely the iWorks template folder into a DMG.
The directory is
/Users/USERNAME/Library/Application Support/iWork/Pages/Templates/My Templates
My Problem is, that I want to put it into a DMG so people can easily install the template. But while it works fine with the Application folder, the template folder always has my username in it. So if someone else opens it, the alias points to the dir with my username, which of course does not exist on a different mac.
Does anyone have any idea how to fix it?
Thanks.
Combining all of your comments to the following I get a droplet working the way I want.
on open thefiles
set outputFolder to (path to application support folder from user domain as text) & "iWork:Pages:Templates:My Templates:"
do shell script "/bin/mkdir -p " & quoted form of POSIX path of outputFolder
tell application "Finder"
duplicate thefiles to outputFolder
end tell
end open
The Problem is, while it works on my mac, I can not use it being inside the DMG file. I can not Drag anything on it. Any ideas?
Thanks so far.
The ~
folder represents the users home directory. So your folder would be ~/Library/Application Support/iWork/Pages/Templates/My Templates
.
In response to your comment: I am not sure if this is possible. You could try ln
from Terminal. It is a utility for making links. But I think it just converts ~
to the actual path of your home directory when you use it. And I think you would have to make a symbolic link as apposed to a hard link, which some file systems might not support (All macs should though). Another possibility would be to make a simple Applescript droplet that uses a shell script to move the file you drag onto it to the path you want. Paste the following code into script editor and save it as an Application or Application Bundle (doesn't matter which):
on open thefile
do shell script "mv " & POSIX path of thefile & " ~/Library/Application\ Support/iWork/Pages/Templates/My\ Templates/"
end open
When you drag a file to the application you made it will move it to your directory. You could change the icon by right clicking on the app and selecting "Get Info", then pasting the new icon on top of the old one, to make it look more like a folder.