Re: Warnings from Terminal and problems running an AppleScript with osascript
Re: Warnings from Terminal and problems running an AppleScript with osascript
- Subject: Re: Warnings from Terminal and problems running an AppleScript with osascript
- From: Doug McNutt <email@hidden>
- Date: Tue, 1 Aug 2006 12:17:14 -0600
At 19:05 +0200 8/1/06, Andrea \"XFox\" Govoni wrote, in part:
>I'm having some problems running a simple AppleScript through the
>osascript command in a shell script. The only task of the script is to
>close the Terminal.app window it is running into.
>The shell script is:
>
><BEGIN SHELL SCRIPT>
>#!/bin/sh
>osascript -e 'tell application "Terminal" to close window 1'
><END SHELL SCRIPT>
>I saved the script in a file with .sh extension, set the execution bit
>on the file and told the Finder to open it with Terminal.app.
1) The extension for a file that OS neXt will recognize as something for Terminal.app is .command
2) You are asking Terminal,app to execute a command in a new window - er shell - which it will open for the purpose. Terminal.app probably has trouble understanding what you mean by window 1. The one it just opened for you?
What happens when you execute the .sh executable from something other than Terminal.app? Do shell script or a BBEdit worksheet for instance?
Terminal.app is funny with AppleScript and tends to ignore requests if it's busy of just pissed off. Asking it twice sometimes works.
Terminal windows can be named so you don't have to worry about which is 1 and which is 2.
<ftp://ftp.macnauchtan.com/Software/Progress/tViewInit>
<ftp://ftp.macnauchtan.com/Software/Progress/>
Are some samples you might find interesting.
Why is Finder not a UNIX shell?
--
Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden