Happy new year everyone.
I wasn't sure how to properly title this one so let me know if you have a better one:
I would like to type a text consisting of different nomenclature and later make it expand.
Below would be how the text is built:
-
Company A/B/C
-
Area 001/002/003
-
A - Architecture
S - Structure
C - Civil
-
WP - Short for Workpack, 50 workpack each.
---
A001AWP001 = Company A, Working in Area 001, Architecture, and workpack 001.
When "A001AWP001" is typed, how can I make it type: "D:\Company A\Area001\Architecture\Workpack 001"?
The idea behind this script is to make it easier to navigate folder higherarchy on a project.
I think the logic would be something like:
1. Create an Array with key/value pair for each nomenclature group (A = Company A, B = Company B, etc)
2. when assigned key is pressed:
2.1 Window Pops Up
2.2 Computer starts to listen to what is being typed and save into a string variable
3. Break down the string input (Company = first char, Area = position 1 ~ 4, etc)
4. Build another string that concatenates with "\" in the middle
5. Make the final input
Any advice would be welcome!
Also, I'm not sure if we can use hotstring for such use?
Thanks
Contextual - Text Expansion
Re: Contextual - Text Expansion
Hallo,
somethink like this?
somethink like this?
Code: Select all
ASC := {A:"Architecture",S:"Structure",C:"Civil"}
q::
InputBox, Text,Nomenclature,,,,100,,,,,A001AWP001
Company := SubStr(Text,1,1)
Area := SubStr(Text,2,3)
ASCn := SubStr(Text,5,1)
Wpn := SubStr(Text,8)
Path := "D:\Company " Company "\Area" Area "\" ASC[ASCn] "\Workpack " Wpn
MsgBox,% Path
Return
Re: Contextual - Text Expansion
Hello,
Thank you for the help!
This looks perfect to get me started.
Can you also help why it wouldn't work when I change the Key/Value pair from one digit to two digits?
For example:
ASC := {AR:"Architecture",ST:"Structure",CI:"Civil"}
I obviously changed the position of the string as well:
ASCn := SubStr(Text,5,2)
I couldn't get this to call the value.
Thanks!
Thank you for the help!
This looks perfect to get me started.
Can you also help why it wouldn't work when I change the Key/Value pair from one digit to two digits?
For example:
ASC := {AR:"Architecture",ST:"Structure",CI:"Civil"}
I obviously changed the position of the string as well:
ASCn := SubStr(Text,5,2)
I couldn't get this to call the value.
Thanks!
Re: Contextual - Text Expansion
Try:
Code: Select all
ASC := {AR:"Architecture",ST:"Structure",CI:"Civil"}
q:: ;changed A001AWP001 to A001ARWP001
InputBox, Text,Nomenclature,,,,100,,,,,A001ARWP001
Company := SubStr(Text,1,1)
Area := SubStr(Text,2,3)
ASCn := SubStr(Text,5,2)
Wpn := SubStr(Text,9)
Path := "D:\Company " Company "\Area" Area "\" ASC[ASCn] "\Workpack " Wpn
MsgBox,% Path
Return
Re: Contextual - Text Expansion
Yep, tried... but still getting:
Re: Contextual - Text Expansion
Strange!
Try:
It should be Unicode.
Try:
Code: Select all
MsgBox,% A_IsUnicode ? "Unicode" : "ANSI"
Re: Contextual - Text Expansion
Yep Weird... any ideas?
Re: Contextual - Text Expansion
what does the unicode msgbox say? and what encoding are you saving the script file in?
Re: Contextual - Text Expansion
The unicode msgbox says "unicode" and I'm not sure how to check the encoding of the script file. How do I go about doing that?
Re: Contextual - Text Expansion
easiest way would be to right click the script, choose Open With -> Notepad, then inside Notepad, use the menu item View->Status Bar, to make sure the status bar at the bottom is showing, and then look for the file encoding at the bottom. ideally you want UTF8 with BOM, or UTF16
Who is online
Users browsing this forum: Bing [Bot], kshitij90 and 336 guests