No need to PREP_PROCESS_<ANYTHING> to access the codes in AE-Script, they are available built-in in two ways:
1. Prefix with two hashtags, ie:
:PRINT ##1800
2. Or use the function "GET_MSG_TXT", ie:
:SET &MSG# = GET_MSG_TXT(1800)
:PRINT &MSG#
GET_MSG_TXT lets you also fill in the "message-inserts", i.e.
:SET &MSG2# = GET_MSG_TXT(00000008,"I faked that one")
:PRINT &MSG2#
------------------------------
Philipp Elmer
Become a member!
https://membership.philippelmer.com------------------------------
Original Message:
Sent: Sep 26, 2023 01:53 AM
From: Christoph Rekers
Subject: DB table for status codes / text?
...or with just AE Script ;-)
:SET &HND#=PREP_PROCESS_FILE(WIN01@SRV-A,"C:\Automic\v21\automationengine\bin\uc.msl", _: "00001???ED*","COL=LENGTH","LENGTH_TAB='4,4,2,100'","UC_LOGIN=LOGIN.ALL.WINDOWS"):PROCESS &HND#:SET &retcode#=GET_PROCESS_LINE(&HND#,2):SET &status#=GET_PROCESS_LINE(&HND#,4):PRINT &retcode# => &status#:ENDPROCESS:CLOSE_PROCESS &HND#
------------------------------
----------------------------------------------------------------
Automic AE Consultant and Trainer since 2000
----------------------------------------------------------------
Original Message:
Sent: Sep 25, 2023 05:25 PM
From: Michael Lowry
Subject: DB table for status codes / text?
It's probably easier to extract the messages from the uc.msl
file and then insert them into a new table with the same structure as MSGTX.
Here's a command that will match AE messages in the uc.msl
file and output tab-separated values:
cat uc.msl | gawk 'match($0, /^([0-9]{8})([EDF])([ACDEIQW])(.*)$/, a) {print a[1] "\t" a[2] "\t" a[3] "\t" a[4]}'
The columns are:
- Message number
- Language
- Message type
- Message text
If you want to print just a subset of messages, change the capture groups in the regex.
- Only English messages: change
[EDF]
to just E
. - Only warning messages:
[ACDEIQW]
to just W
.
From tab-separated values, you can readily generate the SQL statements required to create and populate the table.
Update: I just noticed that the (.*)
capture group is excluding lines with diacritics. Moreover, using regular expressions is probably the wrong approach when we know each line is divided into columns by character position. If anyone knows a straightforward way to insert separator characters at specific columns, that would probably be more reliable.