Clay Posted April 8, 2008 Posted April 8, 2008 Hey guys, Its me again [Clay]...... first off... thanks for all the assistance that you guys gave me with on my last post. I was able to get everything I wanted accomplished and my script worked great!!!.... but now I am falling in-love with Autoit and I might be getting a little ambitious. Here's the deal, I have this really neat VBScript that I would like to covert to Autoit in order to incorporate my result from the vbs into my autoit script and manipulate it. Converting from VBS to Autoit however seems a little more challenging than I first anticipated. Although I have had some success with converting certain vbs functions into Autoit ...it is difficult to get the autoit equivalent of vbs. I found some old script from a past forum that someone created that does some of this stuff (the conversion that is), but it is riddled with errors - which is no big deal because I can fix those, but on complicated vbs scripts it goes crazy. I have included a vbs funtion below which is not very complicated but is very long ...and I am interested in converting it to autoit....would anyone with vbs and autoit expertise be able to help convert this into autoit in the most efficient way as possible? Also.... I need a bit of advice ... would it be foolish to try to use webservices to submit queries in Autoit?... is that at all possible? Has anyone done it before and if so if there a big of code I can take a look at for guidance? expandcollapse popupFunction getUsageBrief() getUsageBrief = "Get latest package(s)" & VbCrLf &_ "cscript -nologo pwcl.vbs getlatestid [getlatestid-options]" & VbCrLf &_ "" & VbCrLf &_ "Download package" & VbCrLf &_ "cscript -nologo pwcl.vbs download [download-options] package-id" & VbCrLf &_ "" & VbCrLf &_ "Display package information" & VbCrLf &_ "cscript -nologo pwcl.vbs packageinfo [packageinfo-options] package-id" & VbCrLf &_ "" & VbCrLf &_ "Display detailed help" & VbCrLf &_ "cscript -nologo pwcl.vbs help" End Function Function getUsageDetail() getUsageDetail = "Package wizard command line utility (pwcl)" & VbCrLf &_ "" & VbCrLf &_ "General syntax" & VbCrLf &_ "cscript -nologo pwcl.vbs {command} [options] operands" & VbCrLf &_ "" & VbCrLf &_ "" & VbCrLf &_ "Get latest package(s)" & VbCrLf &_ "cscript -nologo pwcl.vbs getlatestid [getlatestid-options]" & VbCrLf &_ "" & VbCrLf &_ "Download package" & VbCrLf &_ "cscript -nologo pwcl.vbs download [download-options] package-id" & VbCrLf &_ "" & VbCrLf &_ "Display package information" & VbCrLf &_ "cscript -nologo pwcl.vbs packageinfo [packageinfo-options] package-id" & VbCrLf &_ "" & VbCrLf &_ "Display detailed help" & VbCrLf &_ "cscript -nologo pwcl.vbs help" & VbCrLf &_ "" & VbCrLf &_ "" & VbCrLf &_ "GETLATESTID" & VbCrLf &_ "Queries devcentral database for latest packages matching specified criteria." & VbCrLf &_ "Package Wizard package-ids are outputted, in descending order, one package-id per line." & VbCrLf &_ "" & VbCrLf &_ "syntax:" & VbCrLf &_ "cscript -nologo pwcl.vbs getlatestid [getlatestid-options]" & VbCrLf &_ "" & VbCrLf &_ "getlatestid-options" & VbCrLf &_ "--product=[value,value,...] Product name." & VbCrLf &_ " example: --product=x_trader" & VbCrLf &_ "" & VbCrLf &_ "--vrmf=[value,value,...] Package V.R.M.F where the R, M, & F are optional." & VbCrLf &_ " example: --vrmf=7.3" & VbCrLf &_ "" & VbCrLf &_ "--status=[value,value,...] Package Status. Separate multiple values with commas." & VbCrLf &_ " Default will return packages in all states." & VbCrLf &_ " potential values: Creating Request, New, Developer, Developer Rejected," & VbCrLf &_ " Testing, Pending Testing, Testing Rejected, Release Manager," & VbCrLf &_ " Pending RM,Release Manager Rejected, Prod Released, Failed," & VbCrLf &_ " Cancelled, Working, Error During Web Move, Retired, migrated," & VbCrLf &_ " Archived" & VbCrLf &_ " example: --status=""Testing,Pending Testing""" & VbCrLf &_ "" & VbCrLf &_ "--package_number=[value,value,...]" & VbCrLf &_ " Package number." & VbCrLf &_ " Default will return packages with any package number." & VbCrLf &_ " example: --package=53" & VbCrLf &_ "" & VbCrLf &_ "--ttm=[value,value] Some 6.X products have 2 editions. One using TTM messaging and the" & VbCrLf &_ " other using TIBCO. ttm set to ""1"" indicates the TTM edition." & VbCrLf &_ " 6.X TIBCO and all 7.X products will have ttm set to ""0""." & VbCrLf &_ " Default will return packages with any ttm value." & VbCrLf &_ " potential values: 0,1." & VbCrLf &_ " example --ttm=0" & VbCrLf &_ "" & VbCrLf &_ "--ostype=[value,value,...] Operating system type. Separate multiple values with commas." & VbCrLf &_ " Default will return packages for any OS." & VbCrLf &_ " potential values: win, win64, linux, linux64" & VbCrLf &_ " example: --ostype=win,win64" & VbCrLf &_ "" & VbCrLf &_ "--limit=value Limit the number of packages in the result." & VbCrLf &_ " Default is 1 package." & VbCrLf &_ " example: --limit=100" & VbCrLf &_ "" & VbCrLf &_ "" & VbCrLf &_ "DOWNLOAD" & VbCrLf &_ "Downloads a package to the specified location." & VbCrLf &_ "" & VbCrLf &_ "syntax:" & VbCrLf &_ "cscript -nologo pwcl.vbs download [download-options] package-id" & VbCrLf &_ "" & VbCrLf &_ "operands" & VbCrLf &_ "package-id Package Wizard package-id." & VbCrLf &_ " example: 19718" & VbCrLf &_ "" & VbCrLf &_ "download-options" & VbCrLf &_ "--path=value Package will be saved in this location." & VbCrLf &_ " Default is current working directory" & VbCrLf &_ " example: --path=""C:\some folder""" & VbCrLf &_ "" & VbCrLf &_ "--force If package already exists, force overwrite." & VbCrLf &_ "" & VbCrLf &_ "" & VbCrLf &_ "GETPACKAGEINFO" & VbCrLf &_ "Display package information" & VbCrLf &_ "" & VbCrLf &_ "syntax" & VbCrLf &_ "cscript -nologo pwcl.vbs packageinfo [packageinfo-options] package-id" & VbCrLf &_ "" & VbCrLf &_ "operands" & VbCrLf &_ "package-id Package Wizard package-id." & VbCrLf &_ " example: 19718" & VbCrLf &_ "" & VbCrLf &_ "getpackageinfo-options" & VbCrLf &_ "--display=value Display mode" & VbCrLf &_ " Default is summary" & VbCrLf &_ " potential values: summary, xml" & VbCrLf &_ " example: --display=xml" & VbCrLf &_ "" & VbCrLf &_ "--delim=value Delimiter to be used between output fields." & VbCrLf &_ " Default is "", "" (comma and space)" & VbCrLf &_ " potential values: Any valid string" & VbCrLf &_ " example: --delim="" - """ & VbCrLf &_ "" & VbCrLf &_ "--component_filter=value Only display package components matching this name." & VbCrLf &_ " potential values: Any valid package component." & VbCrLf &_ " example: --component_filter=ttm" & VbCrLf &_ "" & VbCrLf &_ "" & VbCrLf &_ "" & VbCrLf &_ "" & VbCrLf &_ "Examples:" & VbCrLf &_ "" & VbCrLf &_ "Command to find the latest x_trader 7.5 package in the tester queue:" & VbCrLf &_ "cscript -nologo pwcl.vbs getlatestid --product=x_trader --vrmf=7.5 --status=""Testing,Pending Testing""" & VbCrLf &_ "" & VbCrLf &_ "The package id returned by the above command could then be used to download the package:" & VbCrLf &_ "cscript -nologo pwcl.vbs download --path=""C:\some folder"" 19718" & VbCrLf &_ "" & VbCrLf &_ "" End Function
Zedna Posted April 8, 2008 Posted April 8, 2008 Just simple "replaceall" for some words: expandcollapse popupFunc getUsageBrief() Return "Get latest package(s)" & @CRLf & _ "cscript -nologo pwcl.vbs getlatestid [getlatestid-options]" & @CRLf & _ "" & @CRLf & _ "Download package" & @CRLf & _ "cscript -nologo pwcl.vbs download [download-options] package-id" & @CRLf & _ "" & @CRLf & _ "Display package information" & @CRLf & _ "cscript -nologo pwcl.vbs packageinfo [packageinfo-options] package-id" & @CRLf & _ "" & @CRLf & _ "Display detailed help" & @CRLf & _ "cscript -nologo pwcl.vbs help" EndFunc Func getUsageDetail() Return "Package wizard command line utility (pwcl)" & @CRLf & _ "" & @CRLf & _ "General syntax" & @CRLf & _ "cscript -nologo pwcl.vbs {command} [options] operands" & @CRLf & _ "" & @CRLf & _ "" & @CRLf & _ "Get latest package(s)" & @CRLf & _ "cscript -nologo pwcl.vbs getlatestid [getlatestid-options]" & @CRLf & _ "" & @CRLf & _ "Download package" & @CRLf & _ "cscript -nologo pwcl.vbs download [download-options] package-id" & @CRLf & _ "" & @CRLf & _ "Display package information" & @CRLf & _ "cscript -nologo pwcl.vbs packageinfo [packageinfo-options] package-id" & @CRLf & _ "" & @CRLf & _ "Display detailed help" & @CRLf & _ "cscript -nologo pwcl.vbs help" & @CRLf & _ "" & @CRLf & _ "" & @CRLf & _ "GETLATESTID" & @CRLf & _ "Queries devcentral database for latest packages matching specified criteria." & @CRLf & _ "Package Wizard package-ids are outputted, in descending order, one package-id per line." & @CRLf & _ "" & @CRLf & _ "syntax:" & @CRLf & _ "cscript -nologo pwcl.vbs getlatestid [getlatestid-options]" & @CRLf & _ "" & @CRLf & _ "getlatestid-options" & @CRLf & _ "--product=[value,value,...] Product name." & @CRLf & _ " example: --product=x_trader" & @CRLf & _ "" & @CRLf & _ "--vrmf=[value,value,...] Package V.R.M.F where the R, M, & F are optional." & @CRLf & _ " example: --vrmf=7.3" & @CRLf & _ "" & @CRLf & _ "--status=[value,value,...] Package Status. Separate multiple values with commas." & @CRLf & _ " Default will return packages in all states." & @CRLf & _ " potential values: Creating Request, New, Developer, Developer Rejected," & @CRLf & _ " Testing, Pending Testing, Testing Rejected, Release Manager," & @CRLf & _ " Pending RM,Release Manager Rejected, Prod Released, Failed," & @CRLf & _ " Cancelled, Working, Error During Web Move, Retired, migrated," & @CRLf & _ " Archived" & @CRLf & _ " example: --status=""Testing,Pending Testing""" & @CRLf & _ "" & @CRLf & _ "--package_number=[value,value,...]" & @CRLf & _ " Package number." & @CRLf & _ " Default will return packages with any package number." & @CRLf & _ " example: --package=53" & @CRLf & _ "" & @CRLf & _ "--ttm=[value,value] Some 6.X products have 2 editions. One using TTM messaging and the" & @CRLf & _ " other using TIBCO. ttm set to ""1"" indicates the TTM edition." & @CRLf & _ " 6.X TIBCO and all 7.X products will have ttm set to ""0""." & @CRLf & _ " Default will return packages with any ttm value." & @CRLf & _ " potential values: 0,1." & @CRLf & _ " example --ttm=0" & @CRLf & _ "" & @CRLf & _ "--ostype=[value,value,...] Operating system type. Separate multiple values with commas." & @CRLf & _ " Default will return packages for any OS." & @CRLf & _ " potential values: win, win64, linux, linux64" & @CRLf & _ " example: --ostype=win,win64" & @CRLf & _ "" & @CRLf & _ "--limit=value Limit the number of packages in the result." & @CRLf & _ " Default is 1 package." & @CRLf & _ " example: --limit=100" & @CRLf & _ "" & @CRLf & _ "" & @CRLf & _ "DOWNLOAD" & @CRLf & _ "Downloads a package to the specified location." & @CRLf & _ "" & @CRLf & _ "syntax:" & @CRLf & _ "cscript -nologo pwcl.vbs download [download-options] package-id" & @CRLf & _ "" & @CRLf & _ "operands" & @CRLf & _ "package-id Package Wizard package-id." & @CRLf & _ " example: 19718" & @CRLf & _ "" & @CRLf & _ "download-options" & @CRLf & _ "--path=value Package will be saved in this location." & @CRLf & _ " Default is current working directory" & @CRLf & _ " example: --path=""C:\some folder""" & @CRLf & _ "" & @CRLf & _ "--force If package already exists, force overwrite." & @CRLf & _ "" & @CRLf & _ "" & @CRLf & _ "GETPACKAGEINFO" & @CRLf & _ "Display package information" & @CRLf & _ "" & @CRLf & _ "syntax" & @CRLf & _ "cscript -nologo pwcl.vbs packageinfo [packageinfo-options] package-id" & @CRLf & _ "" & @CRLf & _ "operands" & @CRLf & _ "package-id Package Wizard package-id." & @CRLf & _ " example: 19718" & @CRLf & _ "" & @CRLf & _ "getpackageinfo-options" & @CRLf & _ "--display=value Display mode" & @CRLf & _ " Default is summary" & @CRLf & _ " potential values: summary, xml" & @CRLf & _ " example: --display=xml" & @CRLf & _ "" & @CRLf & _ "--delim=value Delimiter to be used between output fields." & @CRLf & _ " Default is "", "" (comma and space)" & @CRLf & _ " potential values: Any valid string" & @CRLf & _ " example: --delim="" - """ & @CRLf & _ "" & @CRLf & _ "--component_filter=value Only display package components matching this name." & @CRLf & _ " potential values: Any valid package component." & @CRLf & _ " example: --component_filter=ttm" & @CRLf & _ "" & @CRLf & _ "" & @CRLf & _ "" & @CRLf & _ "" & @CRLf & _ "Examples:" & @CRLf & _ "" & @CRLf & _ "Command to find the latest x_trader 7.5 package in the tester queue:" & @CRLf & _ "cscript -nologo pwcl.vbs getlatestid --product=x_trader --vrmf=7.5 --status=""Testing,Pending Testing""" & @CRLf & _ "" & @CRLf & _ "The package id returned by the above command could then be used to download the package:" & @CRLf & _ "cscript -nologo pwcl.vbs download --path=""C:\some folder"" 19718" & @CRLf & _ "" & @CRLf & _ "" EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search
Clay Posted April 8, 2008 Author Posted April 8, 2008 Thanks Zedna, Initially when I made an attempt to convert the function to vbs I did just what you provided me with, but I must have done something wrong when I can doing my conversion because SciTE4 complained about my result but yours it seems to be fine with. So thank you for you help, you saved me some headaches. Do you however have any advice on using webservies with autoit... is that a foolish thing to try?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now