Created
August 12, 2020 14:50
-
-
Save rootbsd/f62df5821804577103a14f9e29958c71 to your computer and use it in GitHub Desktop.
material_search.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool val; | |
string Value = ""; | |
void main() { | |
AddStringInput("Value", val); | |
ModalDialog( "Material name:\n", ""); | |
string UserData = rwPath(""); | |
UserData = UserData+ "\\patterns\\" ; | |
// powershell.exe -command "$data = Get-ChildItem -Path 'D:\Documents\3D-CoatV49\patterns\' -Recurse '*.pbrm' | Select-String '<Name>' | Select-String 'grass' | Select-Object -Property Path,Line | format-table -hidetableheaders | out-string ; $data=$data.replace('D:\Documents\3D-CoatV49\patterns\',''); write-output $data.replace('<Name>','---> ').replace('</Name>','') " | |
string part1="/C powershell.exe -command \"$data = Get-ChildItem -Path '"; | |
string part2="' -Recurse '*.pbrm' | Select-String '<Name>' | Select-String '"; | |
string part3="' | Select-Object -Property Path,Line | format-table -hidetableheaders | out-string ; $data=$data.replace('"; | |
string part4="',''); write-output $data.replace('<Name>','---> ').replace('</Name>','') "; | |
string pause=";$t = Read-Host -Prompt 'press enter to close...'"; | |
string WindowsCMD = part1+UserData+part2+Value+part3+UserData+part4+pause; | |
Execute("cmd.exe", WindowsCMD); | |
//ModalDialog( "Command line:\n" + WindowsCMD, ""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment