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


Click here to return to the 'Associate X11 applications with filename extensions' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Associate X11 applications with filename extensions
Authored by: fxt on May 16, '03 07:22:15PM

ok, i finally got this hint to work with a tcsh script and dropscript. still can't figure out why i couldn't get it to work under sh.


#!/bin/tcsh -f

setenv PATH ${PATH}:/sw/bin:/sw/sbin:/usr/bin:/bin
setenv DISPLAY :0.0
/usr/bin/open -a X11

foreach file ($*)
/sw/bin/gv "${file}"
end

you can insert the fancier if-x11-running test mentioned
above if you like. does this work for you cedric?

fxt



[ Reply to This | # ]
Associate X11 applications with filename extensions
Authored by: cedric on May 16, '03 07:53:40PM

> you can insert the fancier if-x11-running test mentioned
> above if you like. does this work for you cedric?

Well, not completely...

I took your version of the script, and change absolutely nothing. So now, when I right-click to a .ps document in the Finder and choose "Open with... Other..." and then choose Dropgv (that I have put in the Applications/Utilities Folder) it works.

So I said "well, I 'get info' on one .ps file and set the preferences to open every .ps file with Dropgv. Then, when I click to a .ps file in the folder or in Mail, it shoud work. "

But it does not. It works only when I click "Open with... Other..." Strange, isn't it? I tried many possibilities, different documents etc. Same behavior for every .ps document.

I checked the console. Sometimes I still get "Unable to open the display" and sometimes I get:

gv: Unable to open the display.
May 16 19:44:45 Cedric-Computer WindowServer[183]: CGXGetWindowShape: Invalid window 2951

or:

May 16 19:44:40 Cedric-Computer WindowServer[183]: CGXGetScreenRectForWindow: Invalid window 6125


We are getting closer to the Truth, but still...

Cedric



[ Reply to This | # ]
Associate X11 applications with filename extensions
Authored by: Karinms on May 30, '03 04:31:43AM

Did you ever figure out what is wrong here? I am having a similar problem with Dropgv. it will work for one file, but when I set it to open all .ps files with Dropgv, it will not work.

On my console I get the message:
2003-05-30 00:57:08.088 Dropgv[4748] *** NSTask: Task create for path /Users/karin/Documents/Dropgv.app/Contents/Resources/script failed: 8, "Exec format error".
May 30 00:57:08 Karin-Sandstroms-Computer crashdump: Crash report written to: /Users/karin/Library/Logs/CrashReporter/Dropgv.crash.log



[ Reply to This | # ]
Associate X11 applications with filename extensions
Authored by: airdrummer on Jun 10, '03 06:50:12PM

bummer...i'm getting the same error)-: any clues?



[ Reply to This | # ]
Associate X11 applications with filename extensions
Authored by: airdrummer on Jun 10, '03 09:37:07PM

oops, i didn't save my script as unix...the mac line endings rilly fsckup bash, although u'd never guess from the error msgs:-P

saving as unix makes the script work, and thus the dropscripted app works...although the "${file}" doesn't quote the args...



[ Reply to This | # ]
Associate X11 applications with filename extensions
Authored by: ssevenup on May 16, '03 08:01:12PM
How exactly are you specifying the environment variables in /bin/sh ? sh and tcsh have different requirements. You can add this to your script after the variables are set to troubleshoot it...

env >env_test.txt
Then look in env_test.txt to see if the variables are actually being set or not after running the script from the command line. --MM

---
Mark Moorcroft
ELORET Corp. - NASA/Ames RC
Sys. Admin.

[ Reply to This | # ]