Jump to content
Sign in to follow this  
Shin003

Automating PDF writer save file as

Recommended Posts

Shin003

Hello all,

I am trying to automate making PDF files from PDF writer. I am using a software similar to AutoCAD or any other CAD software where I need to print different views with PDF writer.

I manage to write a script within the CAD software to display certain features and send the view to Adobe Writer. The save file as window pops and this is where I get stuck.

1. I like to select the path to save to where I have opened the CAD file.

2. I like to have the name of it specific to the view I am displaying.

Run ("allegro.exe")

WinActivate ("Allegro PCB Performance")

WinWait ("Allegro PCB Performance")

Send ("Open {ENTER}") Allows me to select and open file

WinWaitActive ("[CLASS:#32770]")

WinWaitNotActive ("[CLASS:#32770]")

Send ("replay tmp.scr {ENTER}") tmp.scr is CAD software script that lets me change the views

WinWaitActive ("Save PDF File As")

WinActivate ("Save PDF File As")

Is all I got. As you can probably tell I have no idea what I am doing and just to get this far took me a whole day... :(

How do I specify @workdir? How do I copy/paste some text? are some of the questions I have which seemed like it's shown on the help documentation, but I cannot figure out.

I tried looking through the help documentation, but it's really hard to find what I am looking for maybe because I have no experience with any of this.

If anyone can guide me into the right direction I would greatly appreciate it.

Share this post


Link to post
Share on other sites
water

How do I specify @workdir?

You want to save the PDF file in @workdir?

How do I copy/paste some text?

Have a look at ClipPut and ClipGet.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Shin003

You want to save the PDF file in @workdir?

Yes, but when the PDF save as pops up it goes to the folder I last saved PDF at rather than where the file I open is located.

Have a look at ClipPut and ClipGet.

I will take a look at this. Thank you.

Share this post


Link to post
Share on other sites
Shin003

I guess I need to know how to clipGet the @workDIR path also.

Share this post


Link to post
Share on other sites
water

What do you want to do with ClipGet/ClipPut? If you want so pass @workdir to PDF writer simply use Send.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Shin003

What do you want to do with ClipGet/ClipPut? If you want so pass @workdir to PDF writer simply use Send.

Can I use @workingdir with Send so that if it's opened in different folder it'll change where it would save?

PDF writer will only pop open on the last location it saved at right now and not in current working directory.

Share this post


Link to post
Share on other sites
water

This depends on PDF writer. If you can input the path & filename then you can pass @workdir and path using Send.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Shin003

It does allow path and name, but the location I want to save to is different for each project. So I am assuming if I wrote in the path in with Send it would not allow me to change/select the location in the project folder.

Also is there a wild card characters in AutoIt?

I was trying to run Run ("allegro.exe") that would also open the file at the same time in the working folder. Naming of the file goes something like 1234GT.brd where 1234 varies by project, but GT.brd is fixed. I was wondering if I can bypass manually selecting the file using a wild card character if there is only one file that has similar naming.

Share this post


Link to post
Share on other sites
water

Just create a string containing the path and filename and send it to PDF Writer. Example

$sProject = "1234GT.brd"
$sSaveLocation = @WorkDir & "\" & $sProject ; @WorkDir is the working directory of the AutoIt Script!
Send($sSaveLocation)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×