• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OS 9.1 or AppleScript problem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS 9.1 or AppleScript problem?


  • Subject: Re: OS 9.1 or AppleScript problem?
  • From: "Tracy Vanderwerf" <email@hidden>
  • Date: Wed, 21 Nov 2001 11:49:51 -0500
  • Organization: White Directory Publishers

"Expect is a program to control interactive applications. These applications
interactively prompt and expect a user to enter keystrokes in response. By using
Expect, you can write simple scripts to automate these interactions" This is a
direct quote from "Exploring Expect" by Don Libes , an O'Reilly book. I have very
limited knowledge of Expect, so I purchased the book.

The "ocapp" script is never executed. I know this because a dialog box should be
displayed at the beginning of the script and this never appears. Here's the
"Expect" program"

#!/usr/local/bin/expect -f

spawn telnet [lindex $argv 0]
expect "Username"
send "[lindex $argv 1]\r"
expect "Pass"
send "[lindex $argv 2]\r"
expect ">"
send "/EXEC\r"
expect "]"
send " tell application \"Finder\" \r"
expect "]"
send "set path1 to (((path to extensions folder) as string) & \"Scripting
Additions:ocapp\")\r"
expect "]"
send "set job_type to \"[lindex $argv 3]\" \r"
expect "]"
send "set open1 to \"[lindex $argv 4]\" \r"
expect "]"
send "set open2 to \"[lindex $argv 5]\" \r"
expect "]"
send "set close1 to \"[lindex $argv 6]\" \r"
expect "]"
send "set close2 to \"[lindex $argv 7]\" \r"
expect "]"
send "run script alias path1 with parameters { job_type , open1, open2, close1 ,
close2 } \r"
expect "]"
send "end tell \r"
expect "]"
send ".\r"
expect ">"

This does a telnet to the MAC workstation. I know the username and password are OK
because I have done an actual telnet to that station from mine and entered these.
What happens after that, I do not know. I also did change the path of the "ocapp'
script to be in the System folder/Scripting Additions, but that did not make a
difference. If there is some other authentication process going on, I do not know
what it is. I keep thinking something is not set right on the station itself
(preferences, etc), but am running out of ideas.

Here's the beginning of the "ocapp" script:

--set openOne to "DISK28:LOCK:LOCK_ADS:E:04285:1464601.art"
--set openOne to "none"
--set openTwo to "none"
--set closeOne to "none"
--set closeTwo to "none"
--set jobcode to "TYPE"

--on test_it(jobcode, openOne, openTwo, closeOne, closeTwo)
on run {jobcode, openOne, openTwo, closeOne, closeTwo}

set the_version to "Version 2.4.9"
-- Version History --
-- 2.4.1; Added timeout to fileContainer open
-- 2.4.2 ; Added check to file open to avoid opening Quark files
-- 2.4.3 ; Replaced try statements with exists statements
-- 2.4.4; Added "with timeout" statements
-- 2.4.8; Removed Timeout statements - replaced with ignoring application
responses
-- 2.4.9;Altered BC copy to ignore case in book names

global fileContainer
set fileContainer to ""
global the_parent
set the_parent to ""
global debug
set debug to false

tell application "Finder"
-- activate brings the Finder to the front
activate
display dialog "OCAPP Running: " & the_version
end tell

I assume if this dialog box does not appear, the program is not being executed.

Thanks for your help,
TracyV

Mr Tea wrote:

> This from Tracy Vanderwerf - dated 19/11/01 8.13 pm:
>
> > We are trying to move to OS 9.1. Our machines have multiple users activated.
> > An AppleScript is called from an "expect" program. This seems to work fine for
> > the user that is the Mac owner, but the script will not execute if one of the
> > individual users is logged in.
>
> Multiple Users (shudder) can cause all sorts of unexpected problems and
> limitations, it seems. It could be that your script is looking for a certain
> condition to be met, which is only satisfied when the user is the owner.
> Your best bet is to post the actual script here for examination, otherwise
> it's rather difficult to make a guess at what's going wrong.
>
> And, forgive my ignorance, but what is an "expect" programme?
>
> Mr Tea
> --
> _______________________________________________
> applescript-users mailing list
> email@hidden
> http://www.lists.apple.com/mailman/listinfo/applescript-users

[demime 0.98b removed an attachment of type text/x-vcard which had a name of tvanderwerf.vcf]


References: 
 >Re: OS 9.1 or AppleScript problem? (From: Mr Tea <email@hidden>)

  • Prev by Date: Re: ANNOUNCE: XML Tools 2.3.2
  • Next by Date: Re: Maximum Idle time 86400 seconds???
  • Previous by thread: Re: OS 9.1 or AppleScript problem?
  • Next by thread: Sorting
  • Index(es):
    • Date
    • Thread