niftyapple Posted December 24, 2014 Share Posted December 24, 2014 Anyone have a UDF for parsing text in YAML layout? Ive written some other stuff in other languages and using YAML files is amazing with the right utilities. Anyone know of anything? Link to comment Share on other sites More sharing options...
computergroove Posted December 24, 2014 Share Posted December 24, 2014 Can you provide a few lines of example YAML code and what you want autoit to produce? Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
niftyapple Posted December 26, 2014 Author Share Posted December 26, 2014 So here is an example yml format. saveAllUsers: true debug: path: This/Path/for/Files1 showexceptions: true showlogs: false Users: user1: name: John Age: 19 user2: name: Jack Age: 22 DOB: 7/1/92 Just a few simple functions is all I was really after. Read and setValue really. Read could be compatible for something like readYML($file, "Users.user1.name") will return the text string "John". Setvalue I think is where all the tricks come in. setValYML($file, "Users.user1.name.nick", "Johnboy") && setValYML($file, "Users.user3.name", "Bella") && setValYML($file, "Users.user3.favorites", "Pizza, Toast, Fish") Will endup setting the below code. saveAllUsers: true debug: path: This/Path/for/Files1 showexceptions: true showlogs: false Users: user1: name: John nick: JOhnboy Age: 19 user2: name: Jack Age: 22 DOB: 7/1/92 user3: name: Bella favorites: - Pizza - Toast - Fish Tabbing will have to be done in spaces only since traditional YML parsers do not accept tabs. Favorites will be returned as a string with commas separating the items because being able to call them individually with Users.user3.favorites-3 = Fish would be amaze. Seems oddly specific I know, but it would make config files crazy simple since you just call the nodes and it does the rest. Building this into several of my functions would be crazy handy. I sure hope that wasnt to confusing Link to comment Share on other sites More sharing options...
niftyapple Posted December 26, 2014 Author Share Posted December 26, 2014 Here is the YAML site, if you are interested in that as well. http://www.yaml.org/ Link to comment Share on other sites More sharing options...
willichan Posted December 30, 2014 Share Posted December 30, 2014 Since YAML is a super-set of JSON, you might find '?do=embed' frameborder='0' data-embedContent>> to be a good starting point for your UDF. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
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