home *** CD-ROM | disk | FTP | other *** search
/ POWERdrive for you 1997 February / PFY297.ISO / programm / mtb40.ats < prev    next >
Text File  |  1995-11-12  |  25KB  |  749 lines

  1. ACTION    "Go to previous page"
  2. BEHAVIOR    "Goes to the previous page. "
  3. CATEGORY    Navigation
  4. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick
  5. {
  6.   send previous
  7. }
  8.  
  9. ACTION    "Go to next page"
  10. BEHAVIOR    "Goes to the next page. "
  11. CATEGORY    Navigation
  12. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick
  13. {
  14.   send next
  15. }
  16.  
  17. ACTION    "Play a Wave file"
  18. BEHAVIOR    "Plays a wave file using 'WaveFile' ($$WaveFile.) and the 'playSound' function "
  19. CATEGORIES    Multimedia,Audio
  20. ARG    waveFile    FILE    "Wave Files(*.WAV),*.wav"    IS    "Chord.Wav"    help    "Play a wave file."
  21. {
  22.   get playSound("$$WaveFile")
  23. }
  24.  
  25. ACTION    "Go to next page of background"
  26. BEHAVIOR    "Goes to the next page of the current background. "
  27. CATEGORY    Navigation
  28. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick
  29. {
  30.     go to the next page of this background
  31. }
  32.  
  33. ACTION    "Go to previous page of background"
  34. BEHAVIOR    "Goes to the previous page of the current background. "
  35. CATEGORY    Navigation
  36. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick
  37. {
  38.     go to the previous page of this background
  39. }
  40.  
  41. ACTION    "Go to next background"
  42. BEHAVIOR    "Goes to the first page of the background following the current background. "
  43. CATEGORY    Navigation
  44. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick
  45. {
  46.     set sysLockScreen to TRUE
  47.     go to the last page of this background
  48.     send next
  49.     set sysLockScreen to FALSE
  50. }
  51.  
  52. ACTION    "Go to previous background"
  53. BEHAVIOR    "Goes to the first page of the background preceeding the current background. "
  54. CATEGORY    Navigation
  55. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick
  56. {
  57.     set sysLockScreen to TRUE
  58.     go to page 1 of this background
  59.     send previous
  60.     go to page 1 of this background
  61.     set sysLockScreen to FALSE
  62. }
  63.  
  64. ACTION    "Use basic transition effects"
  65. BEHAVIOR    "$$Speed transition with $$Effect to $$pageColor. "
  66. CATEGORY    Effects
  67. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick, leavePage, leaveBackground
  68. ARG    Effect    ONEOF    "blinds,dissolve,drip,fade,iris,puzzle,tear"    IS    "fade"
  69. ARG    Speed    ONEOF    "Normal,Fast,Slow"    IS    "Normal"
  70. ARG    pageColor    ONEOF    "black,blue,cyan,green,gray,magenta,red,white,yellow,lightGray,next page,previous page,first page,last page"    IS    "black"
  71. {
  72.       transition "$$effect $$speed" to $$pageColor
  73.       forward
  74. }
  75.  
  76. ACTION    "Use wipe transition effects"
  77. BEHAVIOR    "$$Speed transition $$dest with $$Effect to $$pageColor. "
  78. CATEGORY    Effects
  79. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick, leavePage, leaveBackground
  80. ARG    Effect    ONEOF    "wipe,push"    IS    "wipe"
  81. ARG    dest    ONEOF    "left,right,top,bottom"    IS    "left"
  82. ARG    Speed    ONEOF    "Normal,Fast,Slow"    IS    "Normal"
  83. ARG    pageColor    ONEOF    "black,blue,cyan,green,gray,magenta,red,white,yellow,lightGray,next page,previous page,first page,last page"    IS    "black"
  84. {
  85.       transition "$$effect $$dest $$speed" to $$pageColor
  86.     forward
  87. }
  88.  
  89. ACTION    "Use page-turning transition effects"
  90. BEHAVIOR    "$$Speed transition $$dest with $$Effect to $$pageColor. "
  91. CATEGORY    Effects
  92. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick, leavePage, leaveBackground
  93. ARG    Effect    ONEOF    "turnPage,rain"    IS    "turnPage"
  94. ARG    dest    ONEOF    "left,right"    IS    "left"
  95. ARG    Speed    ONEOF    "Normal,Fast,Slow"    IS    "Normal"
  96. ARG    pageColor    ONEOF    "black,blue,cyan,green,gray,magenta,red,white,yellow,lightGray,next page,previous page,first page,last page"    IS    "black"
  97. {
  98.       transition "$$effect $$dest $$speed" to $$pageColor
  99.     forward
  100. }
  101.  
  102. ACTION    "Use zoom transition effects"
  103. BEHAVIOR    "$$Speed transition $$dest with $$Effect $$Direction to $$pageColor. "
  104. CATEGORY    Effects
  105. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick, leavePage, leaveBackground
  106. ARG    Effect    ONEOF    "zoom,slide"    IS    "zoom"
  107. ARG    Direction    ONEOF    "in,out"    IS    "out"
  108. ARG    dest    ONEOF    "left,right,top,bottom"    IS    "left"
  109. ARG    Speed    ONEOF    "Normal,Fast,Slow"    IS    "Normal"
  110. ARG    pageColor    ONEOF    "black,blue,cyan,green,gray,magenta,red,white,yellow,lightGray,next page,previous page,first page,last page"    IS    "black"
  111. {
  112.   transition "$$effect $$direction $$dest $$speed" to $$pageColor
  113.   forward
  114. }
  115.  
  116. ACTION    "Use spiral transition effects"
  117. BEHAVIOR    "$$Speed transition with spiral $$Direction to $$pageColor. "
  118. CATEGORY    Effects
  119. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick, leavePage, leaveBackground
  120. ARG    Direction    ONEOF    "in,out"    IS    "out"
  121. ARG    Speed    ONEOF    "Normal,Fast,Slow"    IS    "Normal"
  122. ARG    pageColor    ONEOF    "black,blue,cyan,green,gray,magenta,red,white,yellow,lightGray,next page,previous page,first page,last page"    IS    "black"
  123. {
  124.   transition "spiral $$direction $$speed" to $$pageColor
  125.   forward
  126. }
  127.  
  128. ACTION    "Use split transition effects"
  129. BEHAVIOR    "$$Speed transition $$dest with split $$Direction to $$pageColor. "
  130. CATEGORY    Effects
  131. HANDLERS    buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick, leavePage, leaveBackground
  132. ARG    Direction    ONEOF    "in,out"    IS    "out"
  133. ARG    dest    ONEOF    "horizontal,vertical"    IS    "vertical"
  134. ARG    Speed    ONEOF    "Normal,Fast,Slow"    IS    "Normal"
  135. ARG    pageColor    ONEOF    "black,blue,cyan,green,gray,magenta,red,white,yellow,lightGray,next page,previous page,first page,last page"    IS    "black"
  136. {
  137.   transition "split $$direction $$dest $$speed" to $$pageColor
  138.   forward
  139. }
  140.  
  141. ACTION    "Go to page of hotword"
  142. BEHAVIOR    "Goes to the page corresponding to the text of the hotword. "
  143. CATEGORY    Navigation
  144. HANDLERS    enterHotword, buttonClick, buttonUp, buttonDown, buttonDoubleClick, rightButtonDown, rightButtonUp, rightButtonDoubleClick
  145. ARG    noPage    IS    "That topic does not exist yet."    help    "Text that explains why hotword page does not exist."
  146. {
  147.     if object of target is "hotword"
  148.         -- build pageName
  149.         get "page" && text of target
  150.         -- check to see if page exists
  151.         if isObject(it)
  152.         -- go to page if the page exists
  153.             go it
  154.         -- else, display message that page does not exist  
  155.         else
  156.             request "$$noPage"  
  157.         end if
  158.     end if
  159. }
  160.  
  161. SCRIPT    "Navigate using buttonStillDown"
  162. BEHAVIOR    "Implements multiple page navigation when the mouse button is held down. "
  163. CATEGORY    Navigation
  164. {
  165. to handle buttonDown
  166.     send next 
  167. end buttonDown
  168.  
  169. to handle buttonStillDown
  170.     send buttondown
  171. end buttonStillDown
  172. }
  173.  
  174. ACTION    "Play clip in a stage object"
  175. BEHAVIOR    "Plays a video or animation clip in a stage object "
  176. CATEGORY    Clips
  177. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  178. ARG    StageObj    OBJTYP    "Stage"    IS    "myStage"    help    "Choose the stage object for playback"
  179. {
  180.     mmPlay $$ClipRef in $$StageObj autoclose
  181. }
  182.  
  183. ACTION    "Play clip in a stage and wait"
  184. BEHAVIOR    "Plays a video or animation clip in a stage object and waits till the clip is finished "
  185. CATEGORY    Clips
  186. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  187. ARG    StageObj    OBJTYP    "Stage"    IS    "myStage"    help    "Choose the stage object for playback"
  188. {
  189.     mmPlay $$ClipRef in $$StageObj wait
  190.     get flushMessageQueue()
  191. }
  192.  
  193. ACTION    "Play clip in stage with pre transition"
  194. BEHAVIOR    "Plays a video or animation clip in a stage object with a pre-effect "
  195. CATEGORIES    Clips,Effects
  196. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  197. ARG    StageObj    OBJTYP    "Stage"    IS    "myStage"    help    "Choose the stage object for playback"
  198. ARG    Effect    ONEOF    "blinds,dissolve,drip,fade,iris,push,puzzle,rain,slide,spiral,split,tear,turnPage,wipe,zoom"    IS    "fade"
  199. ARG    Speed    ONEOF    "Normal,Fast,Slow"    IS    "Normal"
  200. ARG    Dest    ONEOF    "left,right,top,bottom,horizontal,vertical,lowerLeft,upperLeft,lowerRight,upperRight"    IS    "left"
  201. ARG    Dir    ONEOF    "in,out"    IS    "out"
  202. {
  203.     -- if you select something unreasonable, ToolBook defaults to something reasonable
  204.     preEffect of $$StageObj = "$$Effect $$Dir $$Dest $$Speed"
  205.     mmPlay $$ClipRef in $$StageObj autoclose
  206. }
  207.  
  208. ACTION    "Play clip in stage with post transition"
  209. BEHAVIOR    "Plays a video or animation clip in a stage object with a post-effect "
  210. CATEGORIES    Clips,Effects
  211. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  212. ARG    StageObj    OBJTYP    "Stage"    IS    "myStage"    help    "Choose the stage object for playback"
  213. ARG    Effect    ONEOF    "blinds,dissolve,drip,fade,iris,push,puzzle,rain,slide,spiral,split,tear,turnPage,wipe,zoom"    IS    "fade"
  214. ARG    Speed    ONEOF    "Normal,Fast,Slow"    IS    "Normal"
  215. ARG    Dest    ONEOF    "left,right,top,bottom,horizontal,vertical,lowerLeft,upperLeft,lowerRight,upperRight"    IS    "left"
  216. ARG    Dir    ONEOF    "in,out"    IS    "out"
  217. {
  218.     -- if you select something unreasonable, ToolBook defaults to something reasonable
  219.     postEffect of $$StageObj = "$$Effect $$Dir $$Dest $$Speed"
  220.     mmPlay $$ClipRef in $$StageObj autoclose
  221. }
  222.  
  223. ACTION    "Play clip in stage with pre- and post-transitions"
  224. BEHAVIOR    "Plays a video or animation clip in a stage object with a pre-effect "
  225. CATEGORIES    Clips,Effects
  226. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  227. ARG    StageObj    OBJTYP    "Stage"    IS    "myStage"    help    "Choose the stage object for playback"
  228. ARG    PreEffect    ONEOF    "blinds,dissolve,drip,fade,iris,push,puzzle,rain,slide,spiral,split,tear,turnPage,wipe,zoom"    IS    "fade"
  229. ARG    PreSpeed    ONEOF    "Normal,Fast,Slow"    IS    "Normal"
  230. ARG    PreDest    ONEOF    "left,right,top,bottom,horizontal,vertical,lowerLeft,upperLeft,lowerRight,upperRight"    IS    "left"
  231. ARG    PreDir    ONEOF    "in,out"    IS    "out"
  232. ARG    PostEffect    ONEOF    "blinds,dissolve,drip,fade,iris,push,puzzle,rain,slide,spiral,split,tear,turnPage,wipe,zoom"    IS    "fade"
  233. ARG    PostSpeed    ONEOF    "Normal,Fast,Slow"    IS    "Normal"
  234. ARG    PostDest    ONEOF    "left,right,top,bottom,horizontal,vertical,lowerLeft,upperLeft,lowerRight,upperRight"    IS    "left"
  235. ARG    PostDir    ONEOF    "in,out"    IS    "out"
  236. {
  237.     -- if you select something unreasonable, ToolBook defaults to something reasonable
  238.     preEffect of $$StageObj = "$$PreEffect $$PreDir $$PreDest $$PreSpeed"
  239.     postEffect of $$StageObj =     "$$PostEffect $$PostDir $$PostDest $$PostSpeed"
  240.     mmPlay $$ClipRef in $$StageObj autoclose
  241. }
  242.  
  243. ACTION    "Play clip and hold"
  244. BEHAVIOR    "Plays a video or animation clip in a stage object and holds the last frame "
  245. CATEGORY    Clips
  246. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  247. ARG    StageObj    OBJTYP    "Stage"    IS    "myStage"    help    "Choose the stage object for playback"
  248. {
  249.     mmOpen $$ClipRef
  250.     mmPlay $$ClipRef in $$StageObj hold
  251. }
  252.  
  253. ACTION    "Play clip"
  254. BEHAVIOR    "Plays a visual clip in the driver's window, or plays an audio clip "
  255. CATEGORY    Clips
  256. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  257. {
  258.     mmPlay $$ClipRef autoclose
  259. }
  260.  
  261. ACTION    "Cue the first frame of an animation or video"
  262. BEHAVIOR    "Preload and cue the first frame of an animation or video on an enter message "
  263. CATEGORY    Clips
  264. HANDLERS    enterPage,enterBackground,enterBook,enterButton,mouseEnter,enterWindow,buttonClick
  265. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  266. {
  267.     if mmIsOpen of $$ClipRef -- not necessary, but nice
  268.         mmClose $$ClipRef wait
  269.     end if
  270.     mmOpen $$ClipRef wait
  271.     mmCue $$ClipRef wait
  272.     forward
  273. }
  274.  
  275. ACTION    "Cue and show the first frame"
  276. BEHAVIOR    "Cue and show the first frame of an animation or video in a stage object "
  277. CATEGORY    Clips
  278. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  279. ARG    StageObj    OBJTYP    "Stage"    IS    "myStage"    help    "Choose the stage object for showing"
  280. {
  281.     if mmIsOpen of $$ClipRef  -- not necessary, but nice
  282.         mmClose $$ClipRef wait
  283.     end if
  284.     mmOpen $$ClipRef wait
  285.      -- strictly speaking, not necessary, but to be on the safe side...
  286.     mmCue $$ClipRef wait
  287.     mmShow $$ClipRef in $$StageObj
  288. }
  289.  
  290. ACTION    "Show a frame"
  291. BEHAVIOR    "Show an arbitrary frame in a video or animation "
  292. CATEGORY    Clips
  293. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  294. ARG    FrameRef    IS    "50"    help    "Any integer value from 0 up to the frame count of the clip."
  295. ARG    StageObj    OBJTYP    "Stage"    IS    "myStage"    help    "Choose the stage object for showing"
  296. {
  297.     -- script is as long as it is because of all the error
  298.     -- handling and "nice"ness
  299.     if mmIsOpen of $$ClipRef    -- not necessary, but nice
  300.         mmClose $$ClipRef wait
  301.     end if
  302.     mmOpen $$ClipRef  wait
  303.     oldMTF = mmTimeFormat of $$ClipRef 
  304.     mmTimeFormat of $$ClipRef = "frames"
  305.     frameVar = $$FrameRef
  306.     -- if frameVar is inappropriate for mmSeek, ToolBook will 
  307.     -- default to something reasonable.
  308.     maxFrame = mmLength of $$ClipRef 
  309.     conditions
  310.     when frameVar < 0
  311.         frameVar = 0
  312.     when frameVar > maxFrame
  313.         frameVar = maxFrame
  314.     end conditions
  315.     mmSeek $$ClipRef to frameVar wait
  316.     mmShow $$ClipRef in $$StageObj wait
  317.     mmTimeFormat of $$ClipRef = oldMTF
  318. }
  319.  
  320. ACTION    "Hide a clip"
  321. BEHAVIOR    "Hide a video or animation "
  322. CATEGORY    Clips
  323. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  324. {
  325.     mmHide $$ClipRef
  326. }
  327.  
  328. ACTION    "Close a clip"
  329. BEHAVIOR    "Closes any clip "
  330. CATEGORY    Clips
  331. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be played."
  332. {
  333.     mmClose $$ClipRef
  334. }
  335.  
  336. ACTION    "Close all clips"
  337. BEHAVIOR    "Closes all open clips, optionally of a certain type "
  338. CATEGORY    Clips
  339. ARG    mediaType    ONEOF    "all,animation,bitmap,cdAudio,digitalVideo,overlay,sequencer,vcr,videodisc,waveAudio"    IS    "all"    help    "Select a device type to close."
  340. {
  341.     mmClose $$mediaType
  342. }
  343.  
  344. ACTION    "Stop a clip"
  345. BEHAVIOR    "Stops any clip "
  346. CATEGORY    Clips
  347. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be stopped."
  348. {
  349.     mmStop $$ClipRef 
  350. }
  351.  
  352. ACTION    "Stop all clips"
  353. BEHAVIOR    "Stops all open clips, optionally of a certain type "
  354. CATEGORY    Clips
  355. ARG    mediaType    ONEOF    "all,animation,bitmap,cdAudio,digitalVideo,overlay,sequencer,vcr,videodisc,waveAudio"    IS    "all"    help    "Select a device type to stop."
  356. {
  357.     mmStop $$mediaType
  358. }
  359.  
  360. ACTION    "Pause a clip"
  361. BEHAVIOR    "Pauses any clip "
  362. CATEGORY    Clips
  363. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be paused."
  364. {
  365.     mmPause $$ClipRef 
  366. }
  367.  
  368. ACTION    "Rewind a clip"
  369. BEHAVIOR    "Rewinds any clip "
  370. CATEGORY    Clips
  371. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be rewound."
  372. {
  373.     mmRewind $$ClipRef 
  374. }
  375.  
  376. ACTION    "Pause all clips"
  377. BEHAVIOR    "Pauses all open clips, optionally of a certain type "
  378. CATEGORY    Clips
  379. ARG    mediaType    ONEOF    "all,animation,bitmap,cdAudio,digitalVideo,overlay,sequencer,vcr,videodisc,waveAudio"    IS    "all"    help    "Select a device type to pause."
  380. {
  381.     mmPause $$mediaType
  382. }
  383.  
  384. ACTION    "Restart a clip with 'release'"
  385. BEHAVIOR    "For restarting a clip that will be released from the system when it finishes playing "
  386. CATEGORY    Clips
  387. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be restarted."
  388. {
  389.     mmPlay $$ClipRef release
  390. }
  391.  
  392. ACTION    "Restart a clip with 'hold'"
  393. BEHAVIOR    "For restarting a clip that will be held when it finishes playing "
  394. CATEGORY    Clips
  395. ARG    ClipRef    CLIP    IS    "clip id 100"    help    "Select the clip to be restarted."
  396. {
  397.     mmPlay $$ClipRef hold
  398. }
  399.  
  400. ACTION    "Bring up the clips db"
  401. BEHAVIOR    "A simple script to bring up the clip dialog box "
  402. CATEGORY    Clips
  403. {
  404.     -- "to system" bypasses any custom handlers and sends the
  405.     -- message straight to ToolBook
  406.     send clips to system
  407. }
  408.  
  409. ACTION    "Bring up the resources db"
  410. BEHAVIOR    "A simple script to bring up the resource manager dialog box "
  411. CATEGORY    Resources
  412. {
  413.     -- "to system" bypasses any custom handlers and sends the
  414.     -- message straight to ToolBook
  415.     send resources to system
  416. }
  417.  
  418. ACTION    "Get clip ref for a stage"
  419. BEHAVIOR    "Gets the reference for a clip or bitmap currently displayed in a stage "
  420. CATEGORY    Clips
  421. ARG    StageObj    OBJTYP    "Stage"    IS    "myStage"    help    "Choose the stage object for playback"
  422. {
  423.     get mediaOpen of $$stageObj
  424.     request it
  425. }
  426.  
  427. ACTION    "Find out if a clip is open"
  428. BEHAVIOR    "Determines whether a clip or bitmap is currently open "
  429. CATEGORY    Clips
  430. ARG    clipRef    CLIP    IS    "clip id 100"    help    "Choose the clip"
  431. {
  432.     get mmIsOpen of $$clipRef
  433.     request it
  434. }
  435.  
  436. ACTION    "Find the length of a clip"
  437. BEHAVIOR    "Gets the length in time for a clip "
  438. CATEGORY    Clips
  439. ARG    clipRef    CLIP    IS    "clip id 100"    help    "Choose the clip"
  440. {
  441.     clipRef = $$clipRef -- cache the reference
  442.     mTF = mmTimeFormat of clipRef
  443.     mmTimeFormat of clipRef = "MSms" -- minutes:seconds:milliseconds
  444.     get mmLength of clipRef
  445.     request clipRef && "is" && char 1 of it && "minutes," \
  446.       && chars 3 to 4 of it && "seconds, and" \
  447.       && chars 6 to 8 of it && "milliseconds long."
  448.     mmTimeFormat of clipRef = mTF
  449. }
  450.  
  451. ACTION    "Find out if clip is playable"
  452. BEHAVIOR    "Determines whether the clip is playable on the current system "
  453. CATEGORY    Clips
  454. ARG    clipRef    CLIP    IS    "clip id 100"    help    "Choose the clip"
  455. {
  456.     clipRef = $$clipRef
  457.     get mmPlayable of clipRef
  458.     if it is TRUE
  459.         request clipRef && "is playable on this system."
  460.     else
  461.         request clipRef && "is not playable on this system."
  462.     end if
  463. }
  464.  
  465. ACTION    "Find a clip's source"
  466. BEHAVIOR    "Determines the source of a clip, either a file or a device "
  467. CATEGORY    Clips
  468. ARG    clipRef    CLIP    IS    "clip id 100"    help    "Choose the clip"
  469. {
  470.     clipRef = $$clipRef
  471.     get mmSource of clipRef
  472.     request "The source for" && clipRef && "is" && it
  473. }
  474.  
  475. ACTION    "Get the status of a clip"
  476. BEHAVIOR    "Get the current status of a clip "
  477. CATEGORY    Clips
  478. ARG    clipRef    CLIP    IS    "clip id 100"    help    "Choose the clip"
  479. {
  480.     get mmStatus of $$clipRef
  481.     request it
  482. }
  483.  
  484. ACTION    "Get the time format of a clip"
  485. BEHAVIOR    "Get the current time format of a clip "
  486. CATEGORY    Clips
  487. ARG    clipRef    CLIP    IS    "clip id 100"    help    "Choose the clip"
  488. {
  489.     get mmTimeFormat of $$clipRef
  490.     request it
  491. }
  492.  
  493. ACTION    "Get the size of a clip"
  494. BEHAVIOR    "Get the default size of a visual clip "
  495. CATEGORY    Clips
  496. ARG    clipRef    CLIP    IS    "clip id 100"    help    "Choose the clip"
  497. {
  498.     clear sysError
  499.     get mmVisualSize of $$clipRef
  500.     if sysError is NULL
  501.         request "The default width is" && item 1 of it \
  502.         & ", and the deafult height is" && item 2 of it
  503.     else
  504.         request "This property is only valid for visual media"
  505.     end if
  506. }
  507.  
  508. ACTION    "Find all open media"
  509. BEHAVIOR    "Reports a list of media that are open at any given time "
  510. CATEGORY    Multimedia
  511. {
  512.     request sysOpenMedia
  513. }
  514.  
  515. ACTION    "Find all supported media"
  516. BEHAVIOR    "Reports a list of media that are supported at any given time "
  517. CATEGORY    Multimedia
  518. {
  519.     request sysSupportedMedia
  520. }
  521.  
  522. ACTION    "Find capability of the timer device"
  523. BEHAVIOR    "Returns information about the capability of the timer "
  524. CATEGORY    Timers
  525. {
  526.     get timerCapability()
  527.     if it <> NULL
  528.         request "Minimum resolution of this timer device is" && item 1 of it \
  529.           && "and the maximum period for it is" && item 2 of it
  530.     end if
  531. }
  532.  
  533. ACTION    "Start a path animation - basic"
  534. BEHAVIOR    "Starts an already defined path animation. The script goes in the animated object. "
  535. CATEGORY    PathAnimation
  536. {
  537.     send playAnimation
  538. }
  539.  
  540. ACTION    "Start a path animation - complete"
  541. BEHAVIOR    "Starts an already defined path animation. The script goes in the animated object. "
  542. CATEGORY    PathAnimation
  543. ARG    animation    ONEOF    "1,2,3,4,5,6"    IS    "1"    help    "Choose the path animation to play that you have already defined."
  544. ARG    notifyObj    IS    "self"    help    "Determine who will be notified when the path animation terminates. Leave blank for no notification."
  545. ARG    wait    ONEOF    "TRUE,FALSE"    IS    "FALSE"    help    "Set wait to true to prevent the user from any action while the path animation is going on."
  546. {
  547.     send playAnimation $$animation, $$notifyObj, $$wait
  548. }
  549.  
  550. SCRIPT    "Receive path animation notification"
  551. BEHAVIOR    "Skeleton script for the path animation notification message "
  552. CATEGORY    PathAnimation
  553. {
  554. to handle doneAnimatingNotify status,target
  555.     request "The status of the path animation is" && status & "." & CRLF &\
  556.     "The target of the path animation was" && target & "."
  557. end 
  558. }
  559.  
  560. SCRIPT    "Full Screen Application"
  561. BEHAVIOR    "Runs a book full screen "
  562. CATEGORY    Viewers
  563. {
  564. to handle enterApplication
  565.     send reader
  566.     captionBar of mainWindow = none
  567.     borderStyle of mainWindow = none
  568.     state of mainWindow = maximized
  569.     forward
  570. end
  571.  
  572. to handle reader
  573.     hide menubar
  574.     captionBar of mainWindow = none
  575.     borderstyle of mainWindow = none
  576.     state of mainWindow = maximized
  577.     forward
  578. end
  579.  
  580. to handle author
  581.     show menubar
  582.     state of mainWindow = normal
  583.     captionBar of mainWindow = normal
  584.     borderstyle of mainWindow = thickframe
  585.     send sizeToPage
  586.     forward
  587. end
  588.  
  589.  
  590. }
  591.  
  592. ACTION    "Exit book"
  593. BEHAVIOR    "Exits the current book "
  594. CATEGORY    Navigation
  595. HANDLERS    buttonDoubleClick, buttonDown, buttonUp, buttonClick
  596. {
  597. send exit
  598. }
  599.  
  600. SCRIPT    "Auto disable NEXT button"
  601. BEHAVIOR    "Automatically disables the button when the last page of the background is reached "
  602. CATEGORY    Navigation
  603. {
  604. notifyBefore enterpage
  605.     enabled of self = (this page <> last page of this background)
  606. end
  607. }
  608.  
  609. SCRIPT    "Auto disable PREVIOUS button"
  610. BEHAVIOR    "Automatically disables the button when page is first page of the background. "
  611. CATEGORY    Navigation
  612. {
  613. notifyBefore enterpage
  614.     enabled of self = (this page <> first page of this background)
  615. end
  616. }
  617.  
  618. SCRIPT    "Auto disable parent button"
  619. BEHAVIOR    "Automatically disables button if name of page is same as button. "
  620. CATEGORY    Navigation
  621. {
  622. notifyBefore enterPage
  623.     enabled of self = (name of this page <> name of self)
  624. end
  625. }
  626.  
  627. SCRIPT    "Smart scroll bars"
  628. BEHAVIOR    "Scroll bars will apper and disappear based on necessity. "
  629. CATEGORY    Fields
  630. {
  631. notifyBefore enterpage
  632.     if textoverflow of self > 0 or textunderflow of self > 0
  633.         if borderstyle of self <> "scrolling"
  634.             borderstyle of self = "scrolling"
  635.         end
  636.     else
  637.         if borderstyle of self <> "rectangle"
  638.             borderstyle of self = "rectangle"
  639.         end
  640.     end
  641. end
  642. }
  643.  
  644. ACTION    "Show Internet Web Page (with prompt for URL)"
  645. BEHAVIOR    "Shows a URL if an Internet browser is available. "
  646. CATEGORIES    Navigation, Internet
  647. HANDLERS    rightButtonUp, rightButtonDown, buttonDown, buttonUp, buttonClick
  648. {
  649.     url = URL of self
  650.     if url = NULL
  651.         ask "What URL should be displayed" with "http://www.asymetrix.com"
  652.         url = it
  653.         URL of self = it
  654.     end
  655.  
  656.     if url <> NULL
  657.         oldCursor = syscursor
  658.         syscursor = 4
  659.     
  660.         getRemote QUOTE&url"E application "NETSCAPE"
  661.         if "no server" is in sysError
  662.             exe = internetBrowser of self
  663.             if exe = NULL
  664.                 linkDll "shell.dll"
  665.                     WORD    FindExecutable        (STRING,STRING,POINTER)
  666.                 end
  667.                 linkDll "tb40win.dll"
  668.                     POINTER getMemBlock            (DWORD)
  669.                     WORD    freeMemBlock        (POINTER)
  670.                 end
  671.             
  672.                 lpBuffer = getMemBlock(256)
  673.                 if lpBuffer <> NULL
  674.                     status = FindExecutable("blank.htm",sysToolBookDirectory,lpBuffer)
  675.                     if status <= 32
  676.                         request "No browser could be located." & CRLF & CRLF & \
  677.                                 "If an internet browser is available on your system, please associate the" && \
  678.                                 QUOTE &"*.htm" & QUOTE && "file extension with your browser."
  679.                     else
  680.                         exe = pointerString(0,lpBuffer)
  681.                         get freeMemBlock(lpBuffer)
  682.                         internetBrowser of self = exe
  683.  
  684.                         run (exe&&URL)
  685.                     end
  686.                 end
  687.             else
  688.                 run (exe&&URL)
  689.             end
  690.         end
  691.     
  692.         syscursor = oldCursor
  693.     end
  694. }
  695.  
  696. ACTION    "Show Internet Web Page (with hard-coded URL)"
  697. BEHAVIOR    "Shows a URL if an Internet browser is available. "
  698. CATEGORIES    Navigation, Internet
  699. HANDLERS    rightButtonUp, rightButtonDown, buttonDown, buttonUp, buttonClick
  700. {
  701.     url = URL of self
  702.     if url = NULL
  703.         ask "What URL should be displayed" with "http://www.asymetrix.com"
  704.         url = it
  705.         URL of self = it
  706.     end
  707.  
  708.     if url <> NULL
  709.         oldCursor = syscursor
  710.         syscursor = 4
  711.     
  712.         getRemote QUOTE&url"E application "NETSCAPE"
  713.         if "no server" is in sysError
  714.             exe = internetBrowser of self
  715.             if exe = NULL
  716.                 linkDll "shell.dll"
  717.                     WORD    FindExecutable        (STRING,STRING,POINTER)
  718.                 end
  719.                 linkDll "tb40win.dll"
  720.                     POINTER getMemBlock        (DWORD)
  721.                     WORD    freeMemBlock        (POINTER)
  722.                 end
  723.             
  724.                 lpBuffer = getMemBlock(256)
  725.                 if lpBuffer <> NULL
  726.                     status = FindExecutable("blank.htm",sysToolBookDirectory,lpBuffer)
  727.                     if status <= 32
  728.                         request "No browser could be located." & CRLF & CRLF & \
  729.                                 "If an WWW browser is available on your system, please register the" && \
  730.                                 QUOTE &"*.htm" & QUOTE && "file extension with your browser."
  731.                     else
  732.                         exe = pointerString(0,lpBuffer)
  733.                         get freeMemBlock(lpBuffer)
  734.                         internetBrowser of self = exe
  735.  
  736.                         run (exe&&URL)
  737.                     end
  738.                 end
  739.             else
  740.                 run (exe&&URL)
  741.             end
  742.         end
  743.     
  744.         syscursor = oldCursor
  745.     end
  746. }
  747.  
  748.  
  749.