 |
 |
Shell script & AppleScript
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2001
Status:
Offline
|
|
Hello
Is it possible to have a UNIX Shell Script that
calls for the execution of an AppleScript?
I tried to save the AppleScript as a MacOS X applet
but it does not work.
I am running MacOS X 10.0 on an iBook.
Thanks for any pointers.
Yorgos Kafkoulis
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
You might like to investigate the osascript command. I'm sure there's been some discussion of it before, you might like to search the archives of this forum and the general discussion forum.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2001
Status:
Offline
|
|
An update.
I was forced to use AppleScript in this case
since the cp command does not copy the resource fork of
a mac file (in HFS, HFS+).
However /Developer/Tools/CpMac does (thanks to Norman Lee for searching about it). So this solves my original problem.
The general problem of invoking an Applescript inside a unix shell
can be solved if someone knows how to execute in a terminal
a MacOS X applet, since the Applescript Editor allows you to save an AppleScript as an MacOS X applet.
Thanks again
Yorgos
|
|
|
| |
|
|
|
 |
|
 |
|
mhencin
|
|
Angus,
I tired the osascript at the command line as follows
osascript scriptnamehere
and get the following error.
Syntax error -1750. Couldn't get error text because of error -1750.
I saved the applescript as a macox applet, and chose never show start upscreen.
If I can launch the script, and use cron, that would be sweet.
Any help is appreciated..
Mike
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
I'm not sure if you can use osascript with applets. Try a precompiled script file, or just a text script file.
|
|
|
| |
|
|
|
 |
|
 |
|
mhencin
|
|
Angus,
Well, I read the man page again, and slower! Also got an email from the applescript guys. I was suprised how quick they replied.
I did get the osascript command to luanch my script. However I did need to use the full path to osascript, like "usr/bin/osascript"
This works fine. the scripts runs, I can tell becaue my classic app does what I then expect. Funny thing is I do not see the script application icon luanch in the dock. Oh well, it works I won't complain.
Mike
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2001
Location: North Andover, MA, USA
Status:
Offline
|
|
Originally posted by mhencin
:
<STRONG>
If I can launch the script, and use cron, that would be sweet.
</STRONG>
You can launch any program (Classic, Carbon or Cocoa) and open any folder in the finder by using the command "open"
here is the syntax:
open [ -a app ] [ -o ] [ -p ] filename ...
You can do "man open" to get more information. if all you want to do is launch your script that was saved as an applet simply type:
open scriptpath
ex. open /Users/admin/scripts/myscript
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jul 2001
Location: Rehoboth Beach DE
Status:
Offline
|
|
mhencin,what is the e-mail of the applescript guys,I need to ask them a few questions.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|