1

Would it be at all possible to do the following:

  1. Place an entire folder within the ~/Library/Application Support folder on a Mac.
  2. Make an alias on the desktop to a link inside that folder.

I'm trying to place an application (with the appropriate configuration files) within that folder and make a alias on the desktop to open said application on several computers. The challenge is the fact that every computer has a different username. Because of that, I'm not sure how to proceed.

edit: I have to following set up, but AppleScript just throws me an error saying error "Can’t make «class ctnr» of \"~/Desktop/Armagetron\" into type text." number -1700 from «class ctnr» of "~/Desktop/Armagetron" to text

tell application "Finder"
    move ((container of "~/Desktop/Armagetron") as text) & "x" to ("~/Library/Application Support")
    make new alias at ("~/Desktop") to (("~/Library/Application Support/Armagetron Advanced.app") as text) & "Application Support:x:y:z"
end tell

The name of the folder itself is Armagetron Advanced while the file I'm trying to the get an alias of is Armagetron Advanced.app. I would like the alias to be placed in ~/Desktop. The location I would like to put the folder into is ~/Library/Application Support.

1 Answer 1

1

You don't specify how you're trying to create the alias (is it a script of some kind?), but you can do this lots of different ways. If you need an actual alias (as opposed to a symlink, which looks similar to the end user but is not the same thing underneath), you will probably have to use AppleScript or Automator, as aliases are only supported within Finder.

So, you can make an AppleScript or Automator script like this:

tell application "Finder"
    make new alias at (path to desktop folder) to ((path to library folder from user domain) as text) & "Application Support:x:y:z"
end tell

You can also run that same script with osascript from the command line.

If a symlink is OK, you can do this in a shell script:

ln -s "${HOME}/Library/Application Support/x/y/z" "${HOME}/Desktop"

edit:

Here is a full script to do what you like:

tell application "Finder"
    move ((container of (path to me)) as text) & "Armagetron Advanced" to ((path to library folder from user domain) as text) & "Application Support"
    make new alias at (path to desktop folder) to ((path to library folder from user domain) as text) & "Application Support:Armagetron Advanced:Armagetron Advanced.app"
end tell
  1. Open AppleScript Editor (type it into the Spotlight search bar in the top right)
  2. Copy and paste the above into the script editor
  3. Change the place-holders (x, &c.) to what you want and save the script as an application
  4. Bundle the script with the folder you want to move into the Library folder
  5. After extracting the script and the folder, you can double-click the script to move the folder and make the alias
6
  • Is there a way to add in placing the folder into the same AppleScript?
    – Kevin Dong
    Commented May 10, 2013 at 23:38
  • Oh, sorry, i forgot that part. How do you mean 'placing the folder'? Are you copying it from somewhere?
    – kine
    Commented May 10, 2013 at 23:40
  • I would like to make a .zip file which has the files and AppleScript present.
    – Kevin Dong
    Commented May 10, 2013 at 23:43
  • OK. I've updated my post to include the full script and instructions for you. Just change the x, y, z bits to the name of your folder and everything. Also, i feel it's worth pointing out that manually running an AppleScript file on each individual machine is not the ideal way to do this, but i suppose you know that
    – kine
    Commented May 10, 2013 at 23:57
  • I tried out your code, AppleScript just throws me an error. I have what I tried to compile in the original post above.
    – Kevin Dong
    Commented May 11, 2013 at 0:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .