topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 8:30 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - pboekers [ switch to compact view ]

Pages: [1]
1
OK here it is.  I am trying to standardize file naming on our systems so that different users are generally forced to apply certain filename attributes to the file. I have started on the AHK script, but start running out of intelligence when it comes to parsing strings, and then joining them together in an array that can copy the string to the clipboard, and then auto paste into a filename field.  In envision this to be a hotkey or event triggered script (preferred), that will present a dialogue box to the user to complete the standardized file name.

I have included the script which I have started below the ----.   What should occur is a file name like this example of a dialogue.

Selected Date: 2009-10-25
Reference # 522225
Sequence # 01
Document Origination And Ownership : C Client
Document Type: IN Invoice
Initial Routing Direction: S Sent Out
Etc. 

With the above example I would process this information by. ...
Select the first letter of "Document Origination And Ownership" which would be "C"
Select the first 2 letters from "Document Type" which would be "IN"
Select the first letter of "Initial Routing Direction" which would be "S"

Then I would pull the descriptions from those same variables like..
Select the 3rd to the end "Document Origination And Ownership" which would be "Client"
Select the 4Th letter FPO the end "Document Type" which would be "Invoice"
Select the 3rd to the end "Initial Routing Direction" which would be "Sent Out"

(Unless there is a way to separate these variables components in the drop down list box like you can do in Excel)

Then I would combine this information into a description into the status bar by joining the above data and adding the red characters below.
522225_01_-_(CINS)_Client_Invoice_Sent_Out_2009-10-25      (Some underscores are added spaces unless included in the variable like in "Sent Out")

During the completion of this dialogue box, I think it would be good to see the filename being composed in the status line.  When the dialogue box is completed, there would be a [OK] button to past this information into the file underlying file name field, and then close the dialogue box.  Yippee, then the core of all our company's file names will be consistent and easily searchable.

Code written so far included below. (Which is activated via Ctrl+T)
----------------------------------------------------

^t::
Gui, Add, MonthCal,  x1 y1 w185 h160 , vMyCalendar

Gui, Add, Text, x190 y7 w80 h20 , Reference #
Gui, Add, Edit, x260 y3 w50 vRefNo

Gui, Add, Text, x330 y7 w200 h20 , Sequence #
Gui, Add, Edit, x390 y3 w20  vSeq

Gui, Add, Text, x190 y30 w200 h20 , Document Orgination And Ownership
Gui, Add, DropDownList, x190 y50 w250 h150 vOwnership , V Vendor|P Company|C Client|O Other


Gui, Add, Text, x190 y80 w200 h20 , Document Type
Gui, Add, DropDownList, x190 y100 w250 h150 vDocumentType , IN Invoice|PS Packing Slip|PO Purchase Order|WO Work Order|CK Check|PD Proofing Document|FF Film|DS Drop Ship Document

Gui, Add, Text, x190 y130 w200 h20 , Initial Routing Direction
Gui, Add, DropDownList, x190 y150 w250 h150 vDirection , S Sent Out|R Returned To Company|F File Only

;Compose Document Code, by extracting document coding letters from drop down boxes.

;Extract The Document Type Codes
 
StringMid, vOTrim, vOwnership, 1, 1
StringMid, vTTrim, vDocumentType, 1, 2
StringMid, vDTrim, vDirection, 1, 1

;Extract The File Descriptions
StringTrimLeft, vOStr, vOwnership, 2
StringTrimLeft, vTStr, vDocumentType, 3
StringTrimLeft, vDStr, vDirection, 2

Gui, Show, w477 h500, New GUI Window
Return

GuiClose:
---------------------------------------------------------
End of code above.

That is it for now. I hope to learn a bit about assigning and combining variables.

Thanks a lot,
Phil

Pages: [1]