06-16-2012, 01:57 AM
Just to update this post a bit.
Using QuickMacros to run scripts on a Linux machine and getting the output to further process.
GetConsoleText does not get text from a PuTTY window.
I've been using the putty log files.
If you open putty, you can configure as many profiles as you may need for jobs where they would all have different log files.
In the "GoogleURL" profile, C:\GoogleURL.txt has been specified as the log file, other settings to overwrite were selected.
Function GoogleURL
Using QuickMacros to run scripts on a Linux machine and getting the output to further process.
GetConsoleText does not get text from a PuTTY window.
I've been using the putty log files.
If you open putty, you can configure as many profiles as you may need for jobs where they would all have different log files.
In the "GoogleURL" profile, C:\GoogleURL.txt has been specified as the log file, other settings to overwrite were selected.
Function GoogleURL
str URL="http://www.quickmacros.com/forum"
str LinuxIP="xxx.xxx.x.x"
str Port="22"
str User=""
str Pass=""
str Script="c:\GoogleURL.sh"
str Output="c:\GoogleURL.txt"
str cURL=
F
;curl https://www.googleapis.com/urlshortener/v1/url -H 'Content-Type: application/json' -d '{{"longUrl": "{URL}"}'
cURL.setfile(Script)
RunConsole2(F"c:\putty.exe -load GoogleURL -ssh {User}@{LinuxIP} {Port} -pw {Pass} -m {Script}")
str Google.getfile(Output)
str pattern="''id'': ''(.*?)'',"
ARRAY(str) a
if(findrx(Google pattern 0 0 a)<0) out "does not match"; ret
str ShortURL=a[1]