|
Post by Johnc on Jun 2, 2018 16:37:04 GMT
So glad I found MMM and this forum! Been using MMM for a week or so and wow it is amazing! Advanced functions like Pixel Colour condition, Network detect, process manipulation etc! Great job Steve!
Been trying to parse %STRING% which contains a typical windows path C:\mmm\tests\example.txt I just need to store "example" into %STRING1%.
Any way to do it? Thanks!
|
|
|
Post by Johnc on Jun 3, 2018 3:54:41 GMT
|
|
|
Post by Johnc on Jun 5, 2018 0:15:16 GMT
Here is a proven solution to parse a string in the clipboard working from the MMM environment: e.g. starting with the string "C:\mmm\tests\example.txt" in clipboard Sample MMM Macro: (based on Steve's delay trick) * | parameter passing to and from CMD via clipboard 1 | RUN ACTION | | | | RUN VIA CMD /C | title=runscript & C:\Program_Portable\mmm\clipname 2 | RUN ACTION | | | | WAIT SECONDS | 1 3 | IF | WINDOW TITLE | runscript | NOT EXIST | CONTINUE 4 | RUN ACTION | | | | MESSAGE PROMPT | %CLIPBOARD%::output The batch file clipname.bat as follows: c:\Program_Portable\mmm\ClipOut | awk -F\ '{ print $NF }' | awk -F. '{print $1}' | clip where: "ClipOut.exe" is a utility to send clipboard content to stdout and "clip" is a standard Windows 7 function to send stdout to Windows clipboard "awk.exe" is a popular text parser used here as an example ClipOut.exe can be downloaded from Jason's site here: jasonfaulkner.com/ClipOut.aspxThis macro returns the name "example" in the clipboard.
|
|