Code: Select all
; PB IDE Tool for Sorted, Searchable "Tabs (Open Files) Menu"
Procedure simpleShell(ShellCommand$)
Protected shell = RunProgram("/bin/sh","","", #PB_Program_Open|#PB_Program_Write)
If shell
WriteProgramStringN(shell,ShellCommand$)
WriteProgramData(shell,#PB_Program_Eof,0)
CloseProgram(shell)
EndIf
EndProcedure
simpleShell(~"osascript\n" +
~"do shell script \"open -a purebasic \" & quoted form of item 1 of (choose from list paragraphs of (do shell script \"echo '" +
GetEnvironmentVariable("PB_TOOL_FileList") +
~"' | grep -i '\" & text returned of (display dialog \"Search:\" default answer \"\") & \"' | sort -f \"))")