home *** CD-ROM | disk | FTP | other *** search
- /*
- Control Tower Arexx Script
- Written By J.L. White
- (C)1995 Merlin's Software
-
- Use this script as a building block to create your own Flyer scripts!
-
- To write scripts to run with Control Tower use "Address CT_1" and use
- "Address FLY_1" for running macros and scripts directly from the Flyer.
- */
-
- signal on error
- signal on syntax
- Options Results
-
-
- Main:
- call OpenStuff()
- call Docs()
- call Routine()
- call CloseStuff()
- exit
- return
-
-
- Routine:
-
- call Info("You Can Have Requesters With Any Text!"," OK ")
- call Info("You Can Have Requesters With\ More Than One Line Of Text"," OK ")
- call Info("You Can Change The Text For The Button As Well!"," I Like This Instead ")
- Address FLY_1 OpenMessageNT "You Can Have Windows With A Message That\Appear While Something Else Is Going On!"
- Address command "C:wait 3"
- call Info("Ok Something Happened So Now You Can Go On!"," Continue ")
- Address FLY_1 CloseMessageNT
-
- Address FLY_1 OpenMessageNT "You Can Select Files From A Standard Amiga ASL Requester!"
- Address command "C:wait 3"
- Address FLY_1 CloseMessageNT
- DriveName = FindDrive()
- FileName = GetFile("Select Clip You Wish To Process! ",DriveName)
- Address FLY_1 OK_TEXT " OK "
- Address FLY_1 FYINT "You Selected "FileName"!"
-
- Address FLY_1 OpenMessageNT "You Can Select A Certain Path To Use!"
- Address command "C:wait 3"
- Address FLY_1 CloseMessageNT
- FileName = GetPath("Select Path To Save Frames To! ","RAM:")
- Address FLY_1 FYINT "You Selected "FileName" As Your Path!"
- Text="You Can Ask Yes Or No Questions!\
- \
- You Can Press [RETURN] For YES\
- Or Press [SPACE BAR] For NO!"
- Answer = YesOrNo(Text," YES "," NO ")
- if Answer = 0 then Name = "NO"
- if Answer = 1 then Name = "YES"
- Address FLY_1 FYINT "You Answered "Name" To That Question!"
-
- Address FLY_1 OpenMessageNT "You Can Ask What Compression Mode To Use!"
- Address command "C:wait 2"
- Address FLY_1 CloseMessageNT
- Address FLY_1 GetCompressionNT
- Mode = result
- if Mode = 0 then Type = "Standard Play"
- if Mode = 1 then Type = "Extended Play"
- if Mode = 2 then Type = "Audio Only"
- if Mode = 3 then Type = "High Quality 5"
- Address FLY_1 OK_TEXT " OK "
- Address FLY_1 FYINT "The Mode You Selected Was "Type"!"
-
- Address FLY_1 OpenMessageNT "You Can Ask What Video Input To Use!"
- Address command "C:wait 2"
- Address FLY_1 CloseMessageNT
- Address FLY_1 GetInputNT
- Type = result
- Address FLY_1 OK_TEXT " OK "
- Address FLY_1 FYINT "You Selected Video Input #"Type
-
- Address FLY_1 OpenMessageNT "You Can Ask What Transition Speed To Use!"
- Address command "C:wait 2"
- Address FLY_1 CloseMessageNT
- Address FLY_1 GetSpeedNT
- Mode = result
- if Mode = 1 then Type = "Slow Speed"
- if Mode = 2 then Type = "Medium Speed"
- if Mode = 3 then Type = "Fast Speed"
- if Mode = 4 then Type = "Variable Speed"
- Address FLY_1 OK_TEXT " OK "
- Address FLY_1 FYINT "The Speed You Selected Was "Type"!"
-
- Address FLY_1 OpenMessageNT "You Can Use String Requesters!"
- Address command "C:wait 2"
- Address FLY_1 CloseMessageNT
- Text = GetText("Enter Text To Use!","")
- Address FLY_1 FYINT "You Entered "Text"!"
-
-
- Address FLY_1 OpenMessageNT "You Can Convert TimeCode To & From Frames!"
- Address command "C:wait 2"
- Address FLY_1 CloseMessageNT
-
- Address FLY_1 SetString "00:00:00:00"
- Address FLY_1 GetStringNTTC "Enter Time Code Number"
- TimeCode = result
- Address FLY_1 ConvertTC TimeCode
- Num = result
- Address FLY_1 FYINT TimeCode" = "Num" Frames"
-
- Address FLY_1 SetString ""
- Address FLY_1 GetStringNT "Enter Number Of Frames"
- Num = result
- Address FLY_1 ConvertNum Num
- TimeCode = result
- Address FLY_1 FYINT Num" Frames = "TimeCode
-
- Address FLY_1 OpenMessageNT " You Can Open A Window To Wait Until \You Have Finished With Something Else"
- Address command "C:wait 4"
- Address FLY_1 CloseMessageNT
- call Set_View(2)
- call Switcher(MDV1)
- call Switcher(PDV2)
- Address FLY_1 WaitSW "Adjust TBAR Then Click Here To Continue!"
-
- Address FLY_1 OpenMessageNT "You Can Click On Buttons Through ARexx!"
- Address FLY_1 ClickMouse "090|312"
- Address FLY_1 ClickMouse "138|312"
- Address FLY_1 ClickMouse "180|312"
- Address FLY_1 ClickMouse "235|312"
- Address FLY_1 ClickMouse "278|312"
- Address FLY_1 CloseMessageNT
-
- Address FLY_1 OpenMessageNT " You Can Even Record What Mouse & Keyboard\Options The User Selects Then Play Them Back!"
- Address command "C:wait 4"
- Address FLY_1 CloseMessageNT
- Address FLY_1 StartRecording
- Address FLY_1 WaitSW "Move Mouse Around Then Click Here To Continue!"
- Address FLY_1 StopRecording
- Address FLY_1 PlayRecording
- Address command "Delete >NIL: RAM:FLY-Record"
- call Set_View(0)
-
- Text ="The possibilites are endless. I hope this example\
- has given you some ideas on how you can incorporate\
- these routines into your own scripts. If you come up\
- with something Really Cool, let us know, we would\
- LOVE to see what you come up with!... Enjoy"
- Address FLY_1 OK_TEXT " THE END "
- Address FLY_1 FYINT Text
- return
-
- GetFile:
- parse Arg Title, Path
- Address FLY_1 SetString Path
- Address FLY_1 GetFileNameNT Title
- return result
-
-
- GetPath:
- parse Arg Title, Path
- Address FLY_1 SetString Path
- Address FLY_1 GetPathNameNT Title
- return result
-
- GetText:
- parse Arg Title, Text
- Address FLY_1 SetString Text
- Address FLY_1 GetStringNT Title
- return result
-
-
- OpenStuff:
- address command "run CT:FLY"
- /* The command above has to be present to access CT commands */
- do while (POS('FLY_1',SHOW('Ports')) = 0)
- address command "wait 1"
- end
- TOASTERLIB="ToasterARexx.port"
- call remlib('ToasterARexx.port')
- call remlib('PROJECT_REXX_PORT')
- call addlib('PROJECT_REXX_PORT' , 0)
- call addlib(TOASTERLIB,0)
- return
-
- CloseStuff:
- Address FLY_1 Quit
- /* The command above has to be present to quit the FLY program */
- call remlib('ToasterARexx.port')
- call remlib('PROJECT_REXX_PORT')
- exit
- return
-
- YesOrNo: procedure
- parse Arg Title,Yes,No
- Address FLY_1 OK_TEXT Yes
- Address FLY_1 CANCEL_TEXT No
- Address FLY_1 AskYesNoNT Title
- if result = "OK" then YesNo = 1
- else YesNo = 0
- return YesNo
-
-
- FindDrive:
- address command "C:Info >RAM:FLY-List"
- call open TempFile,"RAM:FLY-List",R
- do until eof(TempFile)
- line = readln(TempFile)
- parse var line Drive" "Rest
- if Drive = "FA0:" then
- Volume = word(Rest,7)":"
- end
- call close TempFile
- address command "Delete >NIL: RAM:FLY-List"
- return Volume
-
- Info:
- parse Arg Title,Yes
- Address FLY_1 OK_TEXT Yes
- Address FLY_1 FYINT Title
- return
-
-
- Docs:
- Text = " Control Tower Example Routines\
- \
- This Macro is designed to show you some of the\
- Built-In options that can be added to the Flyer\
- By Control Tower. While Newtek does include some\
- options that can be used through Arexx, Control\
- Tower gives you many more Powerful add ons that\
- can take advantage of both the Flyer & Arexx.\
- \
- This window is one example of what can be done.\
- All our Windows & Requesters open up right on\
- the Flyer Screen. This sample script shows what\
- can be done and those of you that know how to\
- write ARexx programs can integrate any of these\
- routines into your own programs. Control Tower\
- doesn't need to be running to use these routines.\
- \
- OK just hit Continue to see what options are now\
- at your disposal. Enjoy..."
-
- Address FLY_1 OK_TEXT " Continue! "
- Address FLY_1 FYINT Text
-
- return
-
-
- syntax:
- error:
- Address FLY_1 OK_TEXT " OK "
- Title = "An Error Was Found With This Macro On Line #"SIGL"!"
- Address FLY_1 FYINT Title
- Address FLY_1 Quit
- exit
-
-