![]() |
|
|
|
|
|||||||
| OS X (Apple) OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running a script without a terminal session | jjinno | Shell Programming and Scripting | 3 | 10-02-2007 10:50 PM |
| run script through terminal | sadiquep | Linux | 4 | 05-24-2007 04:49 AM |
| Script to launch terminal window? | omerta | SUN Solaris | 5 | 06-30-2005 02:48 PM |
| Run the start script from the terminal? Newbie Time! | waking_bear | UNIX for Dummies Questions & Answers | 4 | 03-04-2004 03:09 PM |
| connecting to unix through hyper terminal - as a dumb terminal | michelle | UNIX for Advanced & Expert Users | 2 | 11-05-2001 11:32 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
I'd like to write a script that will run when I log into OS X, which will do the following:
1) Launch Terminal 2) Immediately close the window that Terminal creates when it opens. 3) Preferably, keep Terminal hidden while all this is happening, so all I see is the Terminal icon bouncing in the dock as the program launches. Any advice appreciated PS: I'd prefer the script to be a .sh or a .c file (to compile), as those are the only two languages I have some experience in at the moment. Thanks. |
| Forum Sponsor | ||
|
|
|
|||
|
It would be helpful to know why this operation is important because there may be a better way to accomplish the "why" than you might realize.
I can't image a use for having Terminal launch at startup without a window. Not that there isn't one, but I just can't imagine it. AppleScript can be used to hide a window, but the application first has to create the window (which displays on creation), then hide it immediately. The window is thus only visible for a split second. You can send applescript code from shell scripts using the osascript command (man osascript). You can examine Terminal's applescript functionality from within Script Editor.app by selecting "Open Dictionary..." from the Script Editor "File" menu, then navigating to Terminal.app. Otherwise, I don't know if this is possible from the command line. |
|
|||
|
login hook ?
Maybe a login hook could do the trick?
sudo defaults write com.apple.loginwindow LoginHook /path/to/script (For more information see http://www.bombich.com/mactips/loginhooks.html and http://docs.info.apple.com/article.html?artnum=301446 ) Using AppleScript you could try something like this: osascript -e 'tell application "Terminal" to launch' -e 'tell application "System Events" to set visible of some item of ( get processes whose name = "Terminal" ) to false' Btw, you can 'reset' Terminal.app by deleting the Terminal.plist file: rm "$HOME/Library/Preferences/com.apple.Terminal.plist" |
|||
| Google UNIX.COM |
| Tags |
| linux |
| Thread Tools | |
| Display Modes | |
|
|
|
The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
|
| 421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash for loop boot: cannot open kernel/sparcv9/unix command copy/move folder in unix curses.h cut command in unix daemon process find grep find mtime find null character in a unix file from ip can we get machine name +unix glance unix grep multiple lines grep or grep recursive how to redirect console logs in unix inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime perl array length ping port remove first character from string in k shell replace space by comma , perl script scp recursive segmentation fault(coredump) sftp script snoop unix stale nfs file handle syn_sent tar exclude tar extract to folder unix unix .profile unix forum unix forums unix internals unix interview questions unix mtime unix simulator unix.com vi substitute while loop within while loop shell script |