Go Back   The macosxhints Forums > OS X Help Requests > UNIX - X11



 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 03-14-2003, 03:23 AM   #11
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
57- AppleScript to launch Apple's X11 and The Gimp

(Thanks to Martin Costabel and Marcelo Camperi)


Write a script in AppleScript Editor that looks like this:
Code:
tell application "X11"
	activate
end tell
do shell script "export DISPLAY=:0 && source /sw/bin/init.sh && gimp"
Then save as Application.

Works the same way for any program that uses Apple's X11, was installed by fink, and can be started from the command line.

You can also write a regular shell script to start an application, and then use "DropScript" to generate an application that will run the shell script. The way to activate Apple's X11 by these means is to use the line:

osascript -e 'tell application "X11" to activate'

at the start of your shell script.


About DropScript:

"DropScript is an application for Mac OS X which lets you create new applications from any BSD program which takes files as command line arguments. Typically, these are scripts written in sh, perl, or other scripting languages". (freeware - OSX downloads):

http://www.apple.com/downloads/macos...ropscript.html
sao is offline  
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 02:21 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.