home *** CD-ROM | disk | FTP | other *** search
- 'This Script write the WITHOBJECT
- 'for the selected object and version
- 'Date : 18/03/98 File: Withobject.csc
-
- '/////GLOBAL VARIABLES & CONSTANTS////////////////////////////////////////////////////////
-
- GLOBAL ObjName$ 'name of the object
- GLOBAL Version% 'Version of the object
- GLOBAL LatestVersionis%
- LatestVersionis% = 8 'Latest Version (8)
-
- objgroup%= 3 ' Set the default Object Button to Ventura
- vergroup%= 0 ' Set the default Version button to 8
- BEGIN DIALOG ObjectDialog 233, 140, "Corel SCRIPT Editor - WITHOBJECT Wizard"
- OKBUTTON 67, 116, 40, 14 'The first button is set as default
- CANCELBUTTON 116, 116, 40, 14
- GROUPBOX 12, 44, 97, 66, "Object :"
- OPTIONGROUP objgroup%
- OPTIONBUTTON 17, 59, 81, 11, "Corel&DRAW"
- OPTIONBUTTON 17, 89, 85, 11, "Corel &PHOTO-PAINT"
- OPTIONBUTTON 17, 79, 86, 11, "Corel &SCRIPT Editor"
- OPTIONBUTTON 17, 69, 83, 11, "Corel &VENTURA"
- GROUPBOX 121, 44, 97, 66, "Version :"
- OPTIONGROUP vergroup%
- OPTIONBUTTON 126, 59, 75, 11, "Version &8"
- OPTIONBUTTON 126, 69, 75, 11, "Version &7"
- OPTIONBUTTON 126, 79, 75, 11, "Version &6"
- TEXT 17, 8, 167, 17, "This Wizard will set your WITHOBJECT statement and launch the Corel SCRIPT Editor."
- TEXT 16, 28, 195, 11, "Select the object and the version you want to use."
- END DIALOG
-
-
- ' **************************************************************************************
- ' MAIN
- ' **************************************************************************************
-
-
- ret_val = DIALOG(Objectdialog) 'Pop-up the dialog and assigned to the var. ret_val the value for Ok_button or Cancel_button
-
- ' If return is 2, then Cancel button was chosen
- IF ret_val = 2 THEN STOP
-
-
- Version% = LatestVersionIs% - Vergroup% 'Set the version /
-
-
- SELECT CASE objgroup
- CASE 0
- ' The Corel Draw Button was selected
- Objname$ = "CorelDraw.Automation."
-
- CASE 1
- ' The Corel PhotoPaint Button was selected
- Objname$ = "CorelPhotoPaint.Automation."
-
- CASE 2
- ' The Script Editor Button was selected
- Objname$ = "CorelScript.Automation."
-
- CASE 3
- ' The Ventura Button was selected
- Objname$ = "CorelVentura.Automation."
- END SELECT
-
-
- Start:
-
- WITHOBJECT "CorelScript.Automation.8"
- .SetVisible TRUE 'Make sure the Script Editor is visible (No ghost Copy Running)
- .FileNew 'Open the Script File
- .Gotoline 1 'Plant Caret on the first line
- 'MESSAGE VERSION%
- .AddlineAfter "WITHOBJECT " & CHR(34) & Objname$ & Version% & CHR(34) 'Write the withobject ...
- .AddLineAfter CHR(10) & CHR(10) 'Insert 2 LineFeeds
- .AddlineAfter "END WITHOBJECT" 'Write the end withobject
- .GotoLine 3 'Plant the Caret after the WithObject ... Line
- END WITHOBJECT
-