home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 October A / Pcwk10a98.iso / Corel / Ventura8 / Ventura / Scripts / withobject.csc < prev    next >
Encoding:
Text File  |  1998-04-09  |  2.7 KB  |  78 lines

  1. 'This Script write the WITHOBJECT
  2. 'for the selected object and version
  3. 'Date : 18/03/98 File: Withobject.csc
  4.  
  5. '/////GLOBAL VARIABLES & CONSTANTS////////////////////////////////////////////////////////
  6.  
  7. GLOBAL ObjName$ 'name of the object
  8. GLOBAL Version% 'Version of the object
  9. GLOBAL LatestVersionis%
  10. LatestVersionis% = 8 'Latest Version (8)
  11.  
  12. objgroup%= 3  ' Set the default Object Button to Ventura
  13. vergroup%= 0  ' Set the default Version button to 8
  14. BEGIN DIALOG ObjectDialog 233, 140, "Corel SCRIPT Editor - WITHOBJECT Wizard"
  15.     OKBUTTON  67, 116, 40, 14     'The first button is set as default
  16.     CANCELBUTTON  116, 116, 40, 14
  17.     GROUPBOX  12, 44, 97, 66, "Object :"
  18.     OPTIONGROUP objgroup%
  19.         OPTIONBUTTON  17, 59, 81, 11, "Corel&DRAW"
  20.         OPTIONBUTTON  17, 89, 85, 11, "Corel &PHOTO-PAINT"
  21.         OPTIONBUTTON  17, 79, 86, 11, "Corel &SCRIPT Editor"
  22.         OPTIONBUTTON  17, 69, 83, 11, "Corel &VENTURA"
  23.     GROUPBOX  121, 44, 97, 66, "Version :"
  24.     OPTIONGROUP vergroup%
  25.         OPTIONBUTTON  126, 59, 75, 11, "Version &8"
  26.         OPTIONBUTTON  126, 69, 75, 11, "Version &7"
  27.         OPTIONBUTTON  126, 79, 75, 11, "Version &6"
  28.     TEXT  17, 8, 167, 17, "This Wizard will set your WITHOBJECT statement and launch the Corel SCRIPT Editor."
  29.     TEXT  16, 28, 195, 11, "Select the object and the version you want to use."
  30. END DIALOG
  31.  
  32.  
  33. ' **************************************************************************************
  34. ' MAIN
  35. ' **************************************************************************************
  36.  
  37.  
  38. ret_val = DIALOG(Objectdialog) 'Pop-up the dialog and assigned to the var. ret_val the value for Ok_button or Cancel_button
  39.  
  40. ' If return is 2, then Cancel button was chosen
  41. IF ret_val = 2 THEN STOP
  42.  
  43.  
  44. Version% = LatestVersionIs% - Vergroup% 'Set the version /
  45.  
  46.  
  47. SELECT CASE objgroup
  48.     CASE 0
  49.         ' The Corel Draw Button was selected
  50.         Objname$ = "CorelDraw.Automation."
  51.  
  52.     CASE 1
  53.         ' The Corel PhotoPaint Button was selected
  54.         Objname$ = "CorelPhotoPaint.Automation."
  55.         
  56.     CASE 2
  57.         ' The Script Editor Button was selected
  58.         Objname$ = "CorelScript.Automation."
  59.         
  60.     CASE 3
  61.         ' The Ventura Button was selected
  62.         Objname$ = "CorelVentura.Automation."
  63. END SELECT
  64.  
  65.  
  66. Start:
  67.  
  68. WITHOBJECT "CorelScript.Automation.8"
  69.     .SetVisible TRUE 'Make sure the Script Editor is visible (No ghost Copy Running)
  70.     .FileNew 'Open the Script File
  71.     .Gotoline 1 'Plant Caret on the first line
  72. 'MESSAGE VERSION%    
  73. .AddlineAfter "WITHOBJECT " & CHR(34) & Objname$ & Version% & CHR(34) 'Write the withobject ... 
  74.     .AddLineAfter CHR(10) & CHR(10) 'Insert 2 LineFeeds
  75.     .AddlineAfter "END WITHOBJECT" 'Write the end withobject
  76.     .GotoLine 3 'Plant the Caret after the WithObject ... Line
  77. END WITHOBJECT
  78.