IDE Tool: Tabs Menu

Mac OSX specific forum
User avatar
Piero
Addict
Addict
Posts: 865
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

IDE Tool: Tabs Menu

Post by Piero »

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 \"))")