Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'running generatelinks.sh' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
running generatelinks.sh
Authored by: GlowingApple on Nov 04, '05 04:28:29PM
Thanks! Works great. I changed the code of the original script a bit to be more conducive to a background task:

#!/bin/sh

cd ~/Apps
find -E /Applications/ -regex ".*.app$" -print |
while read APPS; do
  APPLINK=`echo -n "$APPS" | sed s:".*/":"": | sed s:" ":"_":g`
  if [ ! -e "$APPLINK" ]; then
         ln -s open.sh "$APPLINK"
         logger "Created Application symlink for "$APPLINK
  fi
done
This will verify if the symlink exists first, otherwise when it tries to overwrite it generates an error. It will also output the names of the links it creates to the system log, rather than to stdout, which running within launchd isn't really visible. This doesn't cover the problem with apps removed, but simply doing an rm ~/Apps/*.app periodically should fix this.

---
Jayson --When Microsoft asks you, "Where do you want to go today?" tell them "Apple."

[ Reply to This | # ]