home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-04-06 | 3.2 KB | 103 lines | [TEXT/ttxt] |
- -- This script is meant to replace the stack script for the Phone stack
- -- that comes with version 1.1 of HyperCard. It uses an adaptation of a
- -- trick by Daniel J. Rosenbaum that is published in the May 1988 issue
- -- of MacUser. It will send a message to your modem to disconnect two
- -- seconds after it dials a number, giving control of the phone line
- -- back to your phone. All you have to do is pick up the phone within
- -- two seconds, and you’ll be able to hold your conversation. Just open
- -- the stack script for the phone stack (make sure its the new one that
- -- lists local exchanges), select the entire script, and paste this one
- -- in. Dave Fell, 70040,674
-
-
- -- Copyright 1987 Apple Computer, Inc.
-
- on idle
- if the short time ≠ field "loc time"
- then put the short time into field "loc time"
- pass idle
- end idle
-
- on openStack
- show message box
- end openStack
-
- on dial string
- global dialNumber
- put string into dialNumber
- stripNonDials
- if dialNumber is empty then exit dial
- put the length of dialNumber into dialLength
-
- if dialLength < 7 then
- doDial bkgnd field preamble & dialNumber
-
- else if dialLength = 7 then
- put char 1 to 3 of dialNumber into prefix
- repeat with index = 1 to number of words in field "Local Prefixes"
- if word index of field "Local Prefixes" is prefix then
- doDial field preamble & dialNumber
- exit dial
- end if
- end repeat
- answer "Is this a local (non-toll) call?" with No or Yes
- if it is "Yes" then
- put prefix & space after field "Local Prefixes"
- doDial field preamble & dialNumber
- else doDial field preamble & field "toll prefix" & dialNumber
-
- else if dialLength = 8 then
- if offset(field "toll prefix", dialNumber) is 1 then
- doDial field preamble & dialNumber
- else put "This doesn't look like a valid number."
-
- else if dialLength ≥ 9 then dialLD
- end dial
-
- on dialLD
- global dialNumber
- if offset(field "long dist preamble", dialNumber) is 1 then
- repeat for the length of field "long dist preamble"
- delete char 1 of dialNumber
- end repeat
- end if
- if offset(field "area code", dialNumber) is 1 then
- repeat for the length of field "area code"
- delete char 1 of dialNumber
- end repeat
- dial dialNumber
- exit dialLD
- end if
- Dodial field preamble & field "long dist preamble" & dialNumber
- end dialLD
-
- on doDial dialNumber
- put "Now dialing: " & dialNumber
-
- if hilite of bkgnd button "modem (tone dialing)"
- then send "dial" && quote & dialNumber & quote && "with modem" && ¬
- quote & "ATS0=0DT" & quote to HyperCard
-
- if hilite of bkgnd button "modem (pulse dialing)"
- then send "dial" && quote & dialNumber & quote && "with modem" && ¬
- quote & "ATS0=0DP" & quote to HyperCard
-
- if hilite of bkgnd button "speaker (tone dialing)"
- then send "dial" && quote & dialNumber & quote to HyperCard
-
- wait 2 seconds
- send "dial" & quote & empty & quote & "with modem" & quote & ¬
- "+++ATH" & quote to HyperCard
-
- put empty
-
- end doDial
-
- on stripNonDials
- global dialNumber
- repeat with index = the length of dialNumber down to 1
- if char index of dialNumber is not in "0123456789ABCD#*"
- then delete char index of dialNumber
- end repeat
- end stripNonDials
-