Python Forum
Auto-populate Macro variables
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto-populate Macro variables
#1
I've been assigned the task of looking up master routing information for a part number, and changing the assigned Purchase Requisition information from one that is outdated to a new number. This number will be something of the variety 200003215, and unique to each new part number I look up. I will be given this information in a spreadsheet. For similar tasks I use a Python program my colleagues and I have dubbed 'hotstrings.' It is essentially a simple macro program:

import ctypes
ctypes.windll.kernel32.SetConsoleTitleW("Hotstring")
import keyboard as k

h = k.add_abbreviation

h('.A',"APPLE")
h('.B',"BANNANA")
h('.C',"CARROT")
h('.D',"AVOCADO")

You can set up this script to allow you to type a character string, and it prints what ever is in the quotations for you. E.G. typing .A will print Apple in the active field and window you are using. This is useful for tasks requiring the same part number to be put into multiple fields in the ERP system, quickly and efficiently without error. However, I plan to use if for more part numbers than I ever have before, setting it up manually like I usually do would be time consuming.

My question is, is there a way to import a text file or spreadsheet containing the part numbers, and have them automatically enumerate? And I realize enumerating isn't really what I want to do anyway, more I want to have a character sting automatically assigned to each part number. Additionally, the total number of part numbers will be more than 26, if I am able do this, how would I tell it to start over with '.AA','.BB','CC.' ect. when the time comes?

I'm NOT wanting to automate and a find and replace system, I want to retain control over each transaction, but still save time by not having to type each part number in full.

I'm very new to Coding in general and Python in particular, I'm not even sure what questions I should be asking, I hope I've been clear enough to at least get pointed in the right direction.
Reply


Messages In This Thread
Auto-populate Macro variables - by Spartan314 - Mar-03-2021, 07:22 PM
RE: Auto-populate Macro variables - by michael1789 - Mar-03-2021, 08:03 PM
RE: Auto-populate Macro variables - by Spartan314 - Mar-03-2021, 08:57 PM
RE: Auto-populate Macro variables - by Spartan314 - Mar-08-2021, 12:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to populate a dataframe thru line iteration ? knob 0 1,006 May-05-2022, 12:48 AM
Last Post: knob
Question convert autohotkey script to python / macro - press key when pixel get colour willson94d 1 3,665 Jan-01-2022, 08:13 PM
Last Post: Yoriz
  Populate Dropdown list from Database TommyAutomagically 4 4,555 Nov-02-2021, 05:23 PM
Last Post: ndc85430
  Python3 doesn't populate xlsx file with openpyxl Auldyin75 2 2,549 Feb-16-2021, 12:00 PM
Last Post: Auldyin75
  create new tabs and populate using python reggie4 2 2,276 Jan-23-2021, 11:25 PM
Last Post: Larz60+
  Populate a table with variables Market_Python 4 2,595 Jan-11-2021, 09:45 AM
Last Post: Pedroski55
  How do I reduce the time to Invoke Macro via Python? JaneTan 1 2,141 Dec-28-2020, 06:46 AM
Last Post: buran
  Hi Guys, please help me to write SAS macro parameter equivalent code in Python Manohar9589 2 2,611 Jun-14-2020, 05:07 PM
Last Post: Larz60+
  Jython macro which uses PythonInterpreter and Redis script gives an error rkanumola 2 2,257 Oct-30-2019, 07:37 AM
Last Post: rkanumola
  run an excel macro with python mmolet 1 9,039 Apr-02-2019, 09:36 AM
Last Post: Vinci141

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020