06-30-2011
[Solved] Running shell code in AppleScript without Terminal
What I want my script to do is to run a command in Terminal and close that same Terminal window when the process is complete.
Quote:
activate application "Terminal"
tell application "System Events" to keystroke "command"
tell application "System Events" to keystroke return
tell application "Terminal"
quit
end tell
Of course I could ad a delay of 6 seconds to complete the process, but it may not be enough every time.
To simplify my question, this is what I want to achieve.
1. Quit Terminal
after process completes.
2. Quit "that" Terminal window, not
all active Terminal windows.
Thank you
(I didn't exactly knew where to put this topic, so I placed it in here, on second thought it would have been better to put it into "Shell Programming and Scripting" Which I did and got locked. Excuse me for this)
Last edited by ShadowofLight; 06-30-2011 at 03:21 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi mates,
i am trying to run a shell command from my C program in this case let is say the "ls" command. It copiles it okay, and even creates the new fork too. But seems to nothing is happening i mean it is not showing the result of the "ls" command.
I don't know wat i am doing wrong. Any... (1 Reply)
Discussion started by: abdul
1 Replies
2. Shell Programming and Scripting
I am running Mac OS X (10.5). I run the following script successfully in terminal in order to split an mp3 file into 3 smaller mp3 files...
split -b 8667k -a1 Monday.mp3 Levin-Hour_; ls Lev* | sed "s/.*/mv '&' '&.mp3'/g" | zsh
However, when I run a similar script within the Applescript editor... (2 Replies)
Discussion started by: tgaleza
2 Replies
3. Shell Programming and Scripting
I developed a script in Lingon (which is an automated script editor developed for OS X) that is used to automatically restart programs only if they crash. The script itself does just that, but I only want it to load if I'm going to use the specific application that it's designed to protect. In... (3 Replies)
Discussion started by: JFraser1
3 Replies
4. OS X (Apple)
I developed a script in Lingon (which is an automated script editor developed for OS X) that is used to automatically restart programs only if they crash. The script itself does just that, but I only want it to load if I'm going to use the specific application that it's designed to protect. In the... (2 Replies)
Discussion started by: JFraser1
2 Replies
5. Shell Programming and Scripting
I am new to shell scripting.
I tried to run a simple shell script using Cygwin terminal in Win XP env.
The script I have written is as follows -
#!/bin/bash
a=5
] && echo "true" || echo "false"
But when I execute the script, getting some confusing error. The error I am getting are - ... (3 Replies)
Discussion started by: linux_learner
3 Replies
6. Shell Programming and Scripting
The following command works perfectly in Terminal, but not in Applescript. (Returns "unknown token" error for square brackets.)
(new to site. sorry.)
I have an Applescript that is designed to find and remove any square-bracketed text, including the square brackets.
I ran the following code from... (1 Reply)
Discussion started by: Phillip Acosta
1 Replies
7. Shell Programming and Scripting
Hi freinds,
I have tried running a script through cron ,it is a shell script which calls a oracle procedure , problem here is that there is function in sql code which makes a external C call , this function is failing when running manually but works when run manually.
I have trouble shooted... (6 Replies)
Discussion started by: Jcpratap
6 Replies
8. Shell Programming and Scripting
Hi,
I do have an R script named KO.R. Basically reads thousands of files, whose name has a pattern that differs at a portion of the file name, List.txt.
Row_file1_mile.txt
Row_file2_mile.txt
Row_file3_mile.txt
...
...
Row_file1000_mile.txt
Below is a portion of my Rscript that reads... (4 Replies)
Discussion started by: Kanja
4 Replies
9. AIX
Hello every one.
I know little to nothing about AIX. Recently I have been assigned to an AIX project.
For some reason or another the find command is hanging the server.
Well it does not hand server per say, it just freezes my terminal session.
after running find, I waited up to 40 min and... (3 Replies)
Discussion started by: busi386
3 Replies
10. Shell Programming and Scripting
I have cygwin installed on windows server and when I do
echo $SHELL the output is
/bin/bash
I have created a ssh tunnel from this windows server through cygwin to ibm -i series which is running Q-shell.
I am trying to invoke a utility wsadmin (used for scripting) on ibm-i from the... (12 Replies)
Discussion started by: gaurav99
12 Replies
LEARN ABOUT DEBIAN
brlapi_getdrivername
Getting Terminal information(3) BrlAPI Getting Terminal information(3)
NAME
Getting Terminal information -
How to get information about the connected Terminal.
Macros
#define BRLAPI_MAXNAMELENGTH 31
Functions
int BRLAPI_STDCALL brlapi_getDriverName (char *buffer, size_t size)
int BRLAPI_STDCALL brlapi__getDriverName (brlapi_handle_t *handle, char *buffer, size_t size)
int BRLAPI_STDCALL brlapi_getDisplaySize (unsigned int *x, unsigned int *y)
int BRLAPI_STDCALL brlapi__getDisplaySize (brlapi_handle_t *handle, unsigned int *x, unsigned int *y)
Detailed Description
Before using Raw mode or key codes, the application should always check the type of the connected terminal, to be sure it is really the one
it expects.
One should also check for display size, so as to adjust further displaying on it.
Macro Definition Documentation
#define BRLAPI_MAXNAMELENGTH 31
Maximum name length for names embeded in BrlAPI packets, not counting any termination character
Function Documentation
int BRLAPI_STDCALL brlapi__getDisplaySize (brlapi_handle_t *handle, unsigned int *x, unsigned int *y)
int BRLAPI_STDCALL brlapi__getDriverName (brlapi_handle_t *handle, char *buffer, size_tsize)
int BRLAPI_STDCALL brlapi_getDisplaySize (unsigned int *x, unsigned int *y)
Return the size of the braille display
int BRLAPI_STDCALL brlapi_getDriverName (char *buffer, size_tsize)
Return the complete name of the driver used by brltty
This function fills its argument with the whole name of the braille terminal if available, terminated with a '