OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > General

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 24-07-2005, 17:44
groovyd
Guest
 
Posts: n/a
Unhappy Help Creating a Script

I am new to Corel Scripting and am trying to create a simple script to do the following:

1. Convert the selected region to Curves
2. Export the selected region to an EPS file

I cannot find any real documentation on the function calls available and what their parameters mean. I have come up with this but it doesn´t work all the time. it gives an execution error 53... It is corel draw 10. any help?



REM
WITHOBJECT "CorelDraw.Automation.10"
.StartOfRecording
.SuppressPainting
.ConvertToCurves
.GetSize x&,y&
filename$="c:\windows\escritorio\work\eps.eps"
filetype%=1289
dpi%=300
colormode%=6
sx&=x*dpi/FROMINCHES(1)
sy&=y*dpi/FROMINCHES(1)
KILL filename
.FileExport filename$,filetype,sx,sy,dpi,dpi,colormode,1,TRUE,TRUE
.ResumePainting
.EndOfRecording
END WITHOBJECT


Also I would like to have a button in the toolbar that executes this script but havent been successful in figuing out how to put one there.

Reply With Quote
  #2  
Old 25-07-2005, 08:26
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

The first thing I would do, since you are using CD10 is use the VBA record macro button and record the steps you are trying to accomplish. I never had version 10 though (went straight from 8 to 11). However, I have recorded this macro in 12 and maybe Alex can tell you if it needs updating in 10...
Code:
Sub CurveAndExport()
    '
    ' Recorded 7/25/2005
    '
    ' Description:
    '                1. Convert the selected region to Curves
    '                2. Export the selected region to an EPS file
    '
    Dim OrigSelection As ShapeRange
    Set OrigSelection = ActiveSelectionRange
    OrigSelection.ConvertToCurves
    Dim expflt As ExportFilter
    Dim expopt As StructExportOptions
    Set expopt = New StructExportOptions
    expopt.UseColorProfile = False
    Set expflt = ActiveDocument.ExportEx("C:\Documents and Settings\Artist\Desktop\MyFile.eps", cdrEPS, cdrSelection, expopt)
    With expflt
        .Header = 1 ' FilterEPSLib.epsTIFFHeader
        .TIFFHeaderType = 4 ' FilterEPSLib.epsTIFFColor8
        .Resolution = 72
        .Transparent = False
        .TextAsCurves = True
        .IncludeFonts = False
        .ApplyICCProfile = False
        .SendBitmapsAs = 0 ' FilterEPSLib.epsCMYK
        .MaintainOPILinks = False
        .AdjustFountainSteps = False
        .FountainSteps = 128
        .PSLevel = 1 ' FilterEPSLib.epsPSLevel1
        .UserName = ""
        .UseJPEGCompression = False
        .JPEGCompression = 2
        .PreserveOverprints = False
        .OverprintBlack = False
        .AutoSpread = False
        .FixedWidth = False
        .MaxSpread = 1.41732283464567E-04
        .TextSpread = 5.10236220472441E-03
        .BoundingBox = 0 ' FilterEPSLib.epsObjects
        .UseBleed = False
        .Bleed = 31750
        .CropMarks = False
        .UseFloatNumbers = False
        .UseSeparationProfile = True
        .Finish
    End With
End Sub
You may not need all of the filter options that are used here for your EPS, but the recorder is pretty thorough. Unfortunately the recorder does not support all of the functionality of Draw yet (even in v12).
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #3  
Old 25-07-2005, 08:34
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

Now for the toolbar button.

Press CTRL-J on your keyboard to open the Options dialog. Expand Workspace group, then expand Customization and select Commands.
On the right side of the window choose the drop-down and select macros. Here you will see all of the macros on your system (in the Draw GMS folder anyway).
You can drag the macro that you want to a current toolbar or create a new toolbar. You can also specify a shortcut key combination that might work better than a button. I only say better, becuase I find key strokes to be faster than moving my mouse all over the screen all the time.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NEED HELP ON CORELDRAW SCRIPT. FREE PHOTO CALENDAR IF U CAN! johnlfitz CorelDRAW/Corel DESIGNER VBA 8 06-06-2008 23:59
Turning on color calibration in a Corel Script Alien2001 CorelDRAW CS 2 14-07-2005 00:34
VB script to save JPG (photopaint12) tonywong Corel Photo-Paint VBA 2 17-05-2005 09:27
problem with script or macro. Dr Morpheus CorelDRAW/Corel DESIGNER VBA 1 12-02-2004 14:46
Cropmarks script Peter Macros/Add-ons 0 06-11-2003 04:51


All times are GMT -5. The time now is 13:50.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com