-- TIME_STAMP 2020-10-13 01:25:27 v 0.1 local clock = os.clock local sleep = function(n) -- seconds local t0 = clock() while clock() - t0 <= n do end end local FileDir = props['FileDir'] local SaveAs = FileDir..'\\Style.txt' print('- SaveAs = '..SaveAs) --[[----------------------------------------------------------------------- ~--~ os.remove(SaveAs) ~--~ do return end -------------------------------------------------------------------------]] --~ shell = require "shell" local iCaret = editor.CurrentPos local cmd = string.format('"%s" "%s" %i %i "%s"', FileDir..'\\_SciTE_GetStyleAt.exe', props['FilePath'], iCaret, 1, SaveAs) print('> cmd = '..cmd) --~ print(shell.exec(cmd, nil, true, true)) -->> so bleibt das Script hängen!? --~ sleep(1) -- hier funktioniert das sleep, doch ich bräuchte es nach shell.exec local ret = shell.exec(cmd, nil, true, false) --~ sleep(1) -- nach shell.exec funktioniert es aber nicht... -->> ...iTEx\_SciTE_GetStyleAt\_SciTE_GetStyleAt_Example.lua:33: attempt to concatenate local 'style' (a nil value) if ret then local x = 0 for i = 1, 50000, 1 do x = x + 1 end local file = io.open(SaveAs) io.input(file) local style = io.read("*all") io.close(file) print('! style = '..style) -- stimmt nur nach jedem zweiten Aufruf, wenn das Caret versetzt wird und sich der Style dadurch ändert!? end