[GRASS-user] new drag-n-drop mapset for Mac .app build

William Kyngesburye woklist at kyngchaos.com
Fri Jul 13 18:05:11 EDT 2007


On Jul 13, 2007, at 4:27 PM, Mars Sjoden wrote:

> hmm, this is pretty interesting.
>
> Now I am wondering... It maybe conceivable to create a folder  
> action script so that simply "Opening" the Mapset folder will  
> launch your GRASS.app with it's path.
>
Certainly possible.  I wouldn't want to do that myself, since I like  
to poke around in the mapset folder and wouldn't want it to open  
GRASS instead (it would probably already be open in GRASS).

Another possibility would be to use something like OnMyCommand to  
make a contextual menu item that will try to open a selected folder  
in GRASS.

> So did you use an applescript or some such?  Is this new  
> functionality built into a newer build of GRASS.app on your site?
>
> Do you mind sharing the source of this trick, just out of curiousity,
>
It's in the source, so when GRASS.app is built the functionality is  
there.  I haven't updated my binaries yet.  I'll do that later this  
weekend.

It's a part of the AppleScript startup wrapper (GRASS.applescript).   
Basic Applescript handlers, though figuring out the order that the  
event handlers are called when launching an application had me stuck  
for a while (so that it had a chance to process the drag-n-drop  
before attempting to start GRASS without it and quitting).

> Thank you!
>
> Mars
>
>
> On 13-Jul-07, at 9:21 AM, William Kyngesburye wrote:
>
>> It's now possible to drag a mapset folder to the Mac GRASS.app  
>> binary to have it open that mapset immediately on startup.  This  
>> is exactly the same as the commandline startup (which doesn't  
>> directly work with GRASS.app):
>>
>>   grass63 /path/to/db/location/mapset
>>
>> AND, the equivalent commandline startup for GRASS.app (so you  
>> don't need to type the full path to the grass.sh script or mess  
>> with your PATH) is:
>>
>>   open -a "GRASS-6.3.app" /path/to/db/location/mapset
>>
>> Note that this will open a new Terminal window, instead of running  
>> it in the current window.
>>
>>
>> In working this out, I also seem to have fixed the odd PPC problem  
>> where running grass-xterm-wrapper once made it impossible to run  
>> GRASS.app again until Terminal is quit (which meant GRASS also  
>> must be quit).
>>
>> -----
>> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
>> http://www.kyngchaos.com/
>>
>> "I ache, therefore I am.  Or in my case - I am, therefore I ache."
>>
>> - Marvin
>>
>>
>> _______________________________________________
>> grassuser mailing list
>> grassuser at grass.itc.it
>> http://grass.itc.it/mailman/listinfo/grassuser
>
> _______________________________________________
> grassuser mailing list
> grassuser at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grassuser

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly  
what the universe is for and why it is here, it will instantly  
disappear and be replaced by something even more bizarrely  
inexplicable.  There is another theory which states that this has  
already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro





More information about the grass-user mailing list