Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get text with a specific color (user functions) from the QM code editor
#14
I want to use the hotkey Alt+F3 to perform temporary compilation and export functions.
I’d like to know if there’s a simple way to implement the compilation functionality(Ctrl+click(compile)).

Function addManifest
Trigger AF3     Help - how to add the trigger to the macro
 
Code:
Copy      Help
str mf=
;;
;;BEGIN PROJECT
;;main_function  Macro1
;;exe_file  $Temp$\_Temp.exe
;;icon  <default>
;;manifest  $qm$\default.exe.manifest
;;on_after  exportFun
;;flags  7
;;guid  {25416EFA-F9D9-4043-AC7C-50020F98DDB3}
;;END PROJECT
_s.getmacro
_s.addline(mf)
_s.setmacro

;//run Ctrl+click(compile)

Function exportFun
Code:
Copy      Help
mac "sub.exportFun"
ret 1

#sub exportFun
0.3
int h=id(2201 _hwndqm)
int lens=SendMessage(h SCI.SCI_GETTEXTLENGTH 0 0)
str s.fix(SendMessage(h SCI.SCI_GETTEXT lens+1 s.all(lens)))

ARRAY(str) a; findrx(s "^<[^>]+>(.+)$" 0 4|8 a)
for _i 0 a.len
,str n=a[1 _i].trim
,str fo=a[1 0].trim
,_s.getmacro(n)
,_s.setfile(F"$desktop$\{fo}\{n}.txt")

del-  "$Temp$\_Temp.exe"

The following code imports the text of all functions from a folder.
I need to create a trigger that activates when a folder is dragged and dropped into the file list on the left side of QM.
Is this possible?

Function importFun
Code:
Copy      Help
out
Dir d
foreach(d "$desktop$\Macro1\*" FE_Dir)
,str path=d.FullPath ;;out path
,str name=d.FileName; name.getfilename(name) ;;out name
,_s.getfile(path)
,_s.setmacro(name)


Messages In This Thread
RE: Get text with a specific color (user functions) from the QM code editor - by Davider - 04-05-2025, 09:47 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)