home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-1.iso / Files / Tele / Internet / MacHTTP 1.3.sit / MacHTTP 1.3 / MacHTTP Software / Scripts / sample.script < prev    next >
MacBinary  |  1994-05-01  |  2.8 KB  |  [TEXT/ToyS]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: sample.script

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sun May 1 12:54:58 1994, modified Sun May 1 12:54:58 1994, creator 'ToyS', type ASCII, 2256 bytes "sample.script" , at 0x950 330 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[ToyS]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 73 61 6d 70 6c 65 | 2e 73 63 72 69 70 74 00 |..sample|.script.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 54 6f 79 | 53 01 00 00 00 00 00 00 |.TEXTToy|S.......|
|00000050| 00 00 00 00 00 08 d0 00 | 00 01 4a a9 e9 8f 62 a9 |........|..J...b.|
|00000060| e9 8f 62 00 00 06 00 00 | 00 00 00 00 00 00 00 00 |..b.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 0b 19 00 00 |........|........|
|00000080| 2d 2d 20 54 68 69 73 20 | 73 63 72 69 70 74 20 64 |-- This |script d|
|00000090| 65 6d 6f 6e 73 74 72 61 | 74 65 73 20 75 73 69 6e |emonstra|tes usin|
|000000a0| 67 20 41 70 70 6c 65 53 | 63 72 69 70 74 20 77 69 |g AppleS|cript wi|
|000000b0| 74 68 20 4d 61 63 48 54 | 54 50 20 74 6f 20 67 65 |th MacHT|TP to ge|
|000000c0| 6e 65 72 61 74 65 0d 2d | 2d 20 64 79 6e 61 6d 69 |nerate.-|- dynami|
|000000d0| 63 20 57 6f 72 6c 64 20 | 57 69 64 65 20 57 65 62 |c World |Wide Web|
|000000e0| 20 64 6f 63 75 6d 65 6e | 74 73 2e 0d 2d 2d 0d 2d | documen|ts..--.-|
|000000f0| 2d 20 4d 61 63 48 54 54 | 50 20 77 69 6c 6c 20 6f |- MacHTT|P will o|
|00000100| 6e 6c 79 20 72 65 61 64 | 20 61 6e 64 20 65 78 65 |nly read| and exe|
|00000110| 63 75 74 65 20 73 63 72 | 69 70 74 73 20 74 68 61 |cute scr|ipts tha|
|00000120| 74 20 68 61 76 65 20 62 | 65 65 6e 20 73 61 76 65 |t have b|een save|
|00000130| 64 20 61 73 0d 2d 2d 20 | 74 65 78 74 20 6f 6e 6c |d as.-- |text onl|
|00000140| 79 2e 20 4f 6e 63 65 20 | 74 68 65 20 73 63 72 69 |y. Once |the scri|
|00000150| 70 74 20 69 73 20 6c 6f | 61 64 65 64 20 62 79 20 |pt is lo|aded by |
|00000160| 4d 61 63 48 54 54 50 2c | 20 69 74 20 69 73 20 70 |MacHTTP,| it is p|
|00000170| 61 73 73 65 64 20 74 6f | 20 74 68 65 20 64 65 66 |assed to| the def|
|00000180| 61 75 6c 74 0d 2d 2d 20 | 73 63 72 69 70 74 69 6e |ault.-- |scriptin|
|00000190| 67 20 73 79 73 74 65 6d | 20 28 75 73 75 61 6c 6c |g system| (usuall|
|000001a0| 79 20 41 70 70 6c 65 53 | 63 72 69 70 74 29 20 66 |y AppleS|cript) f|
|000001b0| 6f 72 20 79 6f 75 72 20 | 73 65 72 76 65 72 20 66 |or your |server f|
|000001c0| 6f 72 20 65 78 65 63 75 | 74 69 6f 6e 2e 0d 2d 2d |or execu|tion..--|
|000001d0| 20 4d 61 63 48 54 54 50 | 20 70 72 65 70 65 6e 64 | MacHTTP| prepend|
|000001e0| 73 20 74 68 65 20 73 63 | 72 69 70 74 27 73 20 73 |s the sc|ript's s|
|000001f0| 6f 75 72 63 65 20 63 6f | 64 65 20 77 69 74 68 20 |ource co|de with |
|00000200| 61 20 6c 69 6e 65 20 74 | 68 61 74 20 69 73 20 74 |a line t|hat is t|
|00000210| 68 65 20 65 71 75 69 76 | 61 6c 65 6e 74 20 6f 66 |he equiv|alent of|
|00000220| 3a 0d 2d 2d 20 73 65 74 | 20 68 74 74 70 5f 72 65 |:.-- set| http_re|
|00000230| 71 75 65 73 74 20 74 6f | 20 22 3c 72 65 71 75 65 |quest to| "<reque|
|00000240| 73 74 20 66 72 6f 6d 20 | 63 6c 69 65 6e 74 3e 22 |st from |client>"|
|00000250| 0d 2d 2d 20 77 68 65 72 | 65 20 3c 72 65 71 75 65 |.-- wher|e <reque|
|00000260| 73 74 20 66 72 6f 6d 20 | 63 6c 69 65 6e 74 3e 20 |st from |client> |
|00000270| 69 73 20 74 68 65 20 61 | 63 74 75 61 6c 20 64 61 |is the a|ctual da|
|00000280| 74 61 20 72 65 63 65 69 | 76 65 64 20 66 72 6f 6d |ta recei|ved from|
|00000290| 20 74 68 65 20 57 57 57 | 20 63 6c 69 65 6e 74 2e | the WWW| client.|
|000002a0| 0d 2d 2d 0d 2d 2d 20 54 | 68 65 20 72 65 73 75 6c |.--.-- T|he resul|
|000002b0| 74 20 6f 66 20 74 68 65 | 20 73 63 72 69 70 74 20 |t of the| script |
|000002c0| 65 78 65 63 75 74 69 6f | 6e 20 69 73 20 74 68 65 |executio|n is the|
|000002d0| 6e 20 72 65 74 75 72 6e | 65 64 20 74 6f 20 74 68 |n return|ed to th|
|000002e0| 65 20 63 6c 69 65 6e 74 | 20 61 73 20 61 20 48 54 |e client| as a HT|
|000002f0| 4d 4c 0d 2d 2d 20 64 6f | 63 75 6d 65 6e 74 2e 20 |ML.-- do|cument. |
|00000300| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 73 63 |The foll|owing sc|
|00000310| 72 69 70 74 20 73 68 6f | 77 73 20 68 6f 77 20 74 |ript sho|ws how t|
|00000320| 6f 20 74 75 72 6e 20 41 | 70 70 6c 65 53 63 72 69 |o turn A|ppleScri|
|00000330| 70 74 20 72 65 73 75 6c | 74 73 20 69 6e 74 6f 20 |pt resul|ts into |
|00000340| 48 54 4d 4c 2e 0d 0d 73 | 65 74 20 63 72 6c 66 20 |HTML...s|et crlf |
|00000350| 74 6f 20 28 41 53 43 49 | 49 20 63 68 61 72 61 63 |to (ASCI|I charac|
|00000360| 74 65 72 20 31 33 29 20 | 26 20 28 41 53 43 49 49 |ter 13) |& (ASCII|
|00000370| 20 63 68 61 72 61 63 74 | 65 72 20 31 30 29 0d 73 | charact|er 10).s|
|00000380| 65 74 20 68 74 74 70 5f | 31 30 5f 68 65 61 64 65 |et http_|10_heade|
|00000390| 72 20 74 6f 20 22 48 54 | 54 50 2f 31 2e 30 20 32 |r to "HT|TP/1.0 2|
|000003a0| 30 30 20 4f 4b 22 20 26 | 20 63 72 6c 66 20 26 20 |00 OK" &| crlf & |
|000003b0| 22 53 65 72 76 65 72 3a | 20 4d 61 63 48 54 54 50 |"Server:| MacHTTP|
|000003c0| 22 20 26 20 63 72 6c 66 | 20 26 20 c2 0d 09 22 4d |" & crlf| & ..."M|
|000003d0| 49 4d 45 2d 56 65 72 73 | 69 6f 6e 3a 20 31 2e 30 |IME-Vers|ion: 1.0|
|000003e0| 22 20 26 20 63 72 6c 66 | 20 26 20 22 43 6f 6e 74 |" & crlf| & "Cont|
|000003f0| 65 6e 74 2d 74 79 70 65 | 3a 20 74 65 78 74 2f 68 |ent-type|: text/h|
|00000400| 74 6d 6c 22 20 26 20 63 | 72 6c 66 20 26 20 63 72 |tml" & c|rlf & cr|
|00000410| 6c 66 0d 0d 73 65 74 20 | 66 69 6c 65 5f 70 61 74 |lf..set |file_pat|
|00000420| 68 20 74 6f 20 22 3a 53 | 63 72 69 70 74 73 3a 22 |h to ":S|cripts:"|
|00000430| 20 2d 2d 20 69 66 20 74 | 68 69 73 20 73 63 72 69 | -- if t|his scri|
|00000440| 70 74 20 69 73 20 69 6e | 20 61 20 73 75 62 64 69 |pt is in| a subdi|
|00000450| 72 65 63 74 6f 72 79 20 | 62 65 6c 6f 77 20 4d 61 |rectory |below Ma|
|00000460| 63 48 54 54 50 2c 20 63 | 68 61 6e 67 65 20 74 68 |cHTTP, c|hange th|
|00000470| 69 73 20 74 6f 20 74 68 | 65 20 70 72 6f 70 65 72 |is to th|e proper|
|00000480| 20 72 65 6c 61 74 69 76 | 65 20 70 61 74 68 0d 0d | relativ|e path..|
|00000490| 2d 2d 20 43 72 65 61 74 | 65 20 74 68 65 20 74 69 |-- Creat|e the ti|
|000004a0| 74 6c 65 20 66 6f 72 20 | 74 68 65 20 48 54 4d 4c |tle for |the HTML|
|000004b0| 20 64 6f 63 75 6d 65 6e | 74 0d 0d 73 65 74 20 68 | documen|t..set h|
|000004c0| 65 61 64 65 72 20 74 6f | 20 68 74 74 70 5f 31 30 |eader to| http_10|
|000004d0| 5f 68 65 61 64 65 72 20 | 26 20 22 3c 74 69 74 6c |_header |& "<titl|
|000004e0| 65 3e 53 63 72 69 70 74 | 20 54 65 73 74 20 4f 6e |e>Script| Test On|
|000004f0| 65 3c 2f 74 69 74 6c 65 | 3e 3c 68 31 3e 54 68 69 |e</title|><h1>Thi|
|00000500| 73 20 69 73 20 61 20 74 | 65 73 74 3a 3c 2f 68 31 |s is a t|est:</h1|
|00000510| 3e 22 0d 0d 2d 2d 20 41 | 64 64 20 73 6f 6d 65 20 |>"..-- A|dd some |
|00000520| 74 65 78 74 20 74 6f 20 | 74 68 65 20 62 6f 64 79 |text to |the body|
|00000530| 20 6f 66 20 74 68 65 20 | 64 6f 63 75 6d 65 6e 74 | of the |document|
|00000540| 0d 0d 73 65 74 20 62 6f | 64 79 20 74 6f 20 22 54 |..set bo|dy to "T|
|00000550| 68 69 73 20 69 73 20 61 | 20 74 65 73 74 20 6f 66 |his is a| test of|
|00000560| 20 73 70 65 63 69 61 6c | 20 63 68 61 72 73 2e 20 | special| chars. |
|00000570| 53 65 65 20 5c 22 53 70 | 6f 74 5c 22 20 72 75 6e |See \"Sp|ot\" run|
|00000580| 21 20 48 65 72 65 27 73 | 20 61 20 62 61 63 6b 73 |! Here's| a backs|
|00000590| 6c 61 73 68 20 2d 3e 20 | 5c 5c 22 0d 0d 2d 2d 20 |lash -> |\\"..-- |
|000005a0| 53 68 6f 77 20 74 68 65 | 20 63 75 72 72 65 6e 74 |Show the| current|
|000005b0| 20 74 69 6d 65 20 6f 6e | 20 74 68 65 20 73 65 72 | time on| the ser|
|000005c0| 76 65 72 0d 0d 73 65 74 | 20 62 6f 64 79 20 74 6f |ver..set| body to|
|000005d0| 20 62 6f 64 79 20 26 20 | 22 3c 68 32 3e 54 68 65 | body & |"<h2>The|
|000005e0| 20 74 69 6d 65 20 69 73 | 3a 3c 2f 68 32 3e 22 20 | time is|:</h2>" |
|000005f0| 26 20 28 63 75 72 72 65 | 6e 74 20 64 61 74 65 29 |& (curre|nt date)|
|00000600| 0d 0d 2d 2d 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |..-- The| followi|
|00000610| 6e 67 20 73 68 6f 77 73 | 20 68 6f 77 20 74 6f 20 |ng shows| how to |
|00000620| 72 65 66 65 72 65 6e 63 | 65 20 74 68 65 20 61 72 |referenc|e the ar|
|00000630| 67 73 20 70 61 73 73 65 | 64 20 69 6e 20 66 72 6f |gs passe|d in fro|
|00000640| 6d 20 4d 61 63 48 54 54 | 50 0d 0d 73 65 74 20 61 |m MacHTT|P..set a|
|00000650| 72 67 73 20 74 6f 20 22 | 3c 68 32 3e 41 72 67 75 |rgs to "|<h2>Argu|
|00000660| 6d 65 6e 74 73 20 70 61 | 73 73 65 64 20 69 6e 3a |ments pa|ssed in:|
|00000670| 3c 2f 68 32 3e 22 20 26 | 20 68 74 74 70 5f 72 65 |</h2>" &| http_re|
|00000680| 71 75 65 73 74 0d 73 65 | 74 20 73 65 61 72 63 68 |quest.se|t search|
|00000690| 5f 61 72 67 73 20 74 6f | 20 22 3c 68 32 3e 53 65 |_args to| "<h2>Se|
|000006a0| 61 72 63 68 20 61 72 67 | 75 6d 65 6e 74 73 3a 3c |arch arg|uments:<|
|000006b0| 2f 68 32 3e 22 20 26 20 | 68 74 74 70 5f 73 65 61 |/h2>" & |http_sea|
|000006c0| 72 63 68 5f 61 72 67 73 | 0d 0d 2d 2d 20 53 68 6f |rch_args|..-- Sho|
|000006d0| 77 20 61 6c 6c 20 74 68 | 65 20 66 69 6c 65 73 20 |w all th|e files |
|000006e0| 69 6e 20 74 68 65 20 66 | 6f 6c 64 65 72 20 22 66 |in the f|older "f|
|000006f0| 69 6c 65 5f 70 61 74 68 | 22 20 61 6e 64 20 74 75 |ile_path|" and tu|
|00000700| 72 6e 20 48 54 4d 4c 20 | 66 69 6c 65 73 20 69 6e |rn HTML |files in|
|00000710| 74 6f 20 61 6e 63 68 6f | 72 73 0d 0d 73 65 74 20 |to ancho|rs..set |
|00000720| 66 69 6c 65 6c 69 73 74 | 20 74 6f 20 22 3c 68 32 |filelist| to "<h2|
|00000730| 3e 46 69 6c 65 73 20 6f | 6e 20 74 68 65 20 73 65 |>Files o|n the se|
|00000740| 72 76 65 72 3a 3c 2f 68 | 32 3e 3c 75 6c 3e 22 0d |rver:</h|2><ul>".|
|00000750| 73 65 74 20 6c 69 73 74 | 69 6e 67 20 74 6f 20 28 |set list|ing to (|
|00000760| 6c 69 73 74 20 66 6f 6c | 64 65 72 20 66 69 6c 65 |list fol|der file|
|00000770| 20 66 69 6c 65 5f 70 61 | 74 68 29 0d 72 65 70 65 | file_pa|th).repe|
|00000780| 61 74 20 77 69 74 68 20 | 69 20 66 72 6f 6d 20 31 |at with |i from 1|
|00000790| 20 74 6f 20 74 68 65 20 | 6e 75 6d 62 65 72 20 6f | to the |number o|
|000007a0| 66 20 69 74 65 6d 73 20 | 69 6e 20 6c 69 73 74 69 |f items |in listi|
|000007b0| 6e 67 0d 09 73 65 74 20 | 6f 6e 65 5f 66 69 6c 65 |ng..set |one_file|
|000007c0| 20 74 6f 20 69 74 65 6d | 20 69 20 6f 66 20 6c 69 | to item| i of li|
|000007d0| 73 74 69 6e 67 0d 09 69 | 66 20 6f 6e 65 5f 66 69 |sting..i|f one_fi|
|000007e0| 6c 65 20 63 6f 6e 74 61 | 69 6e 73 20 22 2e 68 74 |le conta|ins ".ht|
|000007f0| 6d 6c 22 20 6f 72 20 6f | 6e 65 5f 66 69 6c 65 20 |ml" or o|ne_file |
|00000800| 63 6f 6e 74 61 69 6e 73 | 20 22 2e 73 63 72 69 70 |contains| ".scrip|
|00000810| 74 22 20 74 68 65 6e 0d | 09 09 73 65 74 20 66 69 |t" then.|..set fi|
|00000820| 6c 65 6c 69 73 74 20 74 | 6f 20 66 69 6c 65 6c 69 |lelist t|o fileli|
|00000830| 73 74 20 26 20 22 3c 6c | 69 3e 3c 61 20 68 72 65 |st & "<l|i><a hre|
|00000840| 66 3d 5c 22 22 20 26 20 | 6f 6e 65 5f 66 69 6c 65 |f=\"" & |one_file|
|00000850| 20 26 20 22 5c 22 3e 22 | 20 26 20 6f 6e 65 5f 66 | & "\">"| & one_f|
|00000860| 69 6c 65 20 26 20 22 3c | 2f 61 3e 22 0d 09 65 6c |ile & "<|/a>"..el|
|00000870| 73 65 0d 09 09 73 65 74 | 20 66 69 6c 65 6c 69 73 |se...set| filelis|
|00000880| 74 20 74 6f 20 66 69 6c | 65 6c 69 73 74 20 26 20 |t to fil|elist & |
|00000890| 22 3c 6c 69 3e 22 20 26 | 20 6f 6e 65 5f 66 69 6c |"<li>" &| one_fil|
|000008a0| 65 0d 09 65 6e 64 20 69 | 66 0d 65 6e 64 20 72 65 |e..end i|f.end re|
|000008b0| 70 65 61 74 0d 73 65 74 | 20 66 69 6c 65 6c 69 73 |peat.set| filelis|
|000008c0| 74 20 74 6f 20 66 69 6c | 65 6c 69 73 74 20 26 20 |t to fil|elist & |
|000008d0| 22 3c 2f 75 6c 3e 22 0d | 0d 2d 2d 20 73 65 6e 64 |"</ul>".|.-- send|
|000008e0| 20 69 74 20 61 6c 6c 20 | 62 61 63 6b 20 74 6f 20 | it all |back to |
|000008f0| 74 68 65 20 73 65 72 76 | 65 72 20 66 6f 72 20 74 |the serv|er for t|
|00000900| 72 61 6e 73 6d 69 73 73 | 69 6f 6e 20 74 6f 20 74 |ransmiss|ion to t|
|00000910| 68 65 20 63 6c 69 65 6e | 74 0d 0d 72 65 74 75 72 |he clien|t..retur|
|00000920| 6e 20 68 65 61 64 65 72 | 20 26 20 62 6f 64 79 20 |n header| & body |
|00000930| 26 20 61 72 67 73 20 26 | 20 73 65 61 72 63 68 5f |& args &| search_|
|00000940| 61 72 67 73 20 26 20 66 | 69 6c 65 6c 69 73 74 0d |args & f|ilelist.|
|00000950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000980| 00 00 01 00 00 00 01 18 | 00 00 00 18 00 00 00 32 |........|.......2|
|00000990| 80 00 07 e1 88 10 18 60 | 1c 10 18 67 24 6a 0e e1 |.......`|...g$j..|
|000009a0| 88 10 18 e1 88 10 18 e1 | 88 10 18 60 08 24 00 61 |........|...`.$.a|
|000009b0| 0d 73 61 6d 70 6c 65 2e | 73 63 72 69 70 74 02 00 |.sample.|script..|
|000009c0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|000009d0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 a9 f8 f2 a1 00 00 | 00 00 00 00 01 4a 03 60 |........|.....J.`|
|00000a00| 02 12 c2 51 c8 ff fc 4e | d0 80 0a 5a 45 52 4f 42 |...Q...N|...ZEROB|
|00000a10| 55 46 46 45 52 00 00 00 | 00 00 00 0a 9e 00 01 00 |UFFER...|........|
|00000a20| 00 00 00 00 14 00 00 01 | e1 00 00 00 00 71 04 72 |........|.....q.r|
|00000a30| 30 f0 02 0a 0e 7a 0e 82 | 04 8a 0e 92 04 a2 04 9a |0....z..|........|
|00000a40| 04 aa 04 b2 0e 8a 0e 72 | 48 0f 52 65 73 43 68 65 |.......r|H.ResChe|
|00000a50| 63 6b 20 41 6c 65 72 74 | 73 81 04 2a b1 04 32 81 |ck Alert|s..*..2.|
|00000a60| ff f4 21 04 32 81 ff ec | 21 04 32 b1 04 4a 81 ff |..!.2...|!.2..J..|
|00000a70| f8 21 04 4a b1 04 3a 81 | ff f4 21 04 3a b1 04 52 |.!.J..:.|..!.:..R|
|00000a80| 00 00 00 14 00 5e ff 8b | 02 3e 02 7e 00 28 00 02 |.....^..|.>.~.(..|
|00000a90| 01 dd 02 5d 00 01 00 00 | 00 00 01 00 00 00 01 18 |...]....|........|
|00000aa0| 00 00 00 18 00 00 00 32 | 00 a4 a8 08 1d 62 00 00 |.......2|.....b..|
|00000ab0| 00 1c 00 32 00 00 57 50 | 6f 73 00 00 00 0a 00 80 |...2..WP|os......|
|00000ac0| ff ff 00 00 00 00 00 a4 | a5 88 00 00 00 00 00 00 |........|........|
|00000ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+