#!/bin/zsh -f
argarray=("$@")
filepath=($argarray[2,-1])
if [[ -d /Applications/Utilities/X11.app ]];then
open -a X11
fi
if [[ -d /sw/bin ]];then
source /sw/bin/init.sh
fi
export DISPLAY=:0.0
cd "$(dirname "$filepath" )"
xemacs "$(basename "$filepath" )"
XEmacs Wrapper
wrapper to allow XEmacs to run from the Finder
Version: 1.05
Great idea. I made one too.
Feedback Type: Commentary
Contributed by: wgscott Thursday, May 26 2005 @ 08:45 PM PDT
Product Platform: MacOSX
Used Product For: Have Not Tried
Recommend Product: YES
I was curious to see how similar mine was to yours. I have the following differences, which, if you want, you should feel free to make use of any that might be worthwhile:
1. open -a X11 avoids using the osascript to call X11
2. I cd to the directory containing the edited file that is dragged and dropped onto the app.
3. The code below handles all the spaces -- zsh treats this stuff as arrays and doesn't split words with the spaces.
4. I only made mine for fink but it could be extended. Another improvement would be to check what the DISPLAY really should be set to for multiple users (it isn't always :0.0). I have a zsh script that does that too.
Nice ideas! - hypert3000
Thanks! I've incorporated using "open -a X11" into version 1.05. If you look in the script bundled inside the XEmacs Wrapper package, you'll that mine is a little more complex. One "hidden" feature of my script is that it can also be used stand-alone (not inside this Platypus-created package). If you call this script directly from the Terminal, it's still a convenient way to bring X11 to the front and open XEmacs. Things get complicated in the script because Platypus changes how the arguments are processed, but the script does take care of all that. Literally, I use this all day long from the Terminal (launching files by hand) and from the Finder (drag-and-dropping files onto the XEmacs Wrapper app/icon).Reply to This
Wednesday, June 01 2005 @ 07:44 PM PDT