PDA

Показать полную графическую версию : Настройка русской версии SciTE под AutoIt


Страниц : [1] 2 3

Vlasssov
26-04-2010, 20:32
При установке русской версии компиляции не выполняются скрипты lua по постановке bookmarks. В Консоле пишет ошибку
> Lua: error checking global scope for command
Кто-нибудь пытался запустить эту сборку для работы со скриптами?

Creat0R
26-04-2010, 20:57
При установке русской версии компиляции не выполняются скрипты lua по постановке bookmarks »
Не удалось понять предложение :dont-know .

Iska
26-04-2010, 21:56
Очевидно, подразумевается сборка с ресурса scite-ru - Project Hosting on Google Code (http://code.google.com/p/scite-ru/)?!

Creat0R
26-04-2010, 22:02
Очевидно, подразумевается сборка с ресурса scite-ru - Project Hosting on Google Code?! »
Я знаю (догадываюсь) про какую сборку идёт речь, но я всё ровно не могу понять то предложение.

Vlasssov
26-04-2010, 22:31
Я знаю (догадываюсь) про какую сборку идёт речь, но я всё ровно не могу понять то предложение. »
А вы поставьте - и попробуйте... Всё станет ясно.
Просто попробуйте ХОТЬ одну команды запустить, которая в разделе прописана для au3.

Creat0R
26-04-2010, 23:07
А вы поставьте - и попробуйте »
Пока не хочу :jester:

Просто попробуйте ХОТЬ одну команды запустить, которая в разделе прописана для au3 »
Значит получается что из первого сообщения я должен был понять что проблема в запуске команды меню? :o

Vlasssov
26-04-2010, 23:13
Значит получается что из первого сообщения я должен был понять что проблема в запуске команды меню? »
Так, понятно... Вы до меня что донести хотите? Сборку не устанавливали, предложения не поняли.. Что еще?

Creat0R
26-04-2010, 23:25
попробуйте ХОТЬ одну команды запустить, которая в разделе прописана для au3 »
Там вшиты пути, например к AutoIt, в файле «languages\au3.properties»:
autoit3dir=C:\program files\autoit3
я бы указал относительный путь:
autoit3dir=$(SciteDefaultHome)\..

для MsgBox и Bookmark в папке SciTE должен быть файл AutoIt3.lua, его нет.

Вы до меня что донести хотите? »
Что темы желательно оформлять по яснее, ответ получите намного быстрее (во, даже в рифму :gitara: ).

Vlasssov
30-04-2010, 08:51
Что темы желательно оформлять по яснее, ответ получите намного быстрее »
Уважаемый Креатор,
Вы почти что провокатор,
Не поставив русской сборки
Вы меня подвергли порке..
Но совет ваш, к сожаленью,
Не привел меня к решенью.
Я же все ж вам благодарен:
Стих ваш просто гениален!
Вам воздам хвалу тотчас.
Я влюбился просто в вас!
Вы знаток AutoIT,
Да еще притом - пиит!!!

А файла там действительно не было... Но после того как я его туда скопировал - делу это не помогло. Пошел я пообщаюсь с авторами этой русской сборки...

kaster
30-04-2010, 13:07
Vlasssov, пять баллов :biggrin:
по поводу русской сборки, у них тоже есть конференция. можешь там попросить совета

Creat0R
30-04-2010, 15:40
после того как я его туда скопировал - делу это не помогло »
А я вот поставил эту сборку, поместил её в папку AutoIt'а, заменив пути в конфигах, всё работает (кроме функции с «AutoIt3.lua», кстати где этот файл взять?).

Vlasssov
30-04-2010, 20:53
А я вот поставил эту сборку, поместил её в папку AutoIt'а, заменив пути в конфигах, всё работает (кроме функции с «AutoIt3.lua», кстати где этот файл взять?). »
Я о том же... Сборка то хороша сама по себе, там много вещей уже готовых, тот же sidebar..
Копировал я туда файл
AutoItTools.lua из сборки с сайта AutoIt - все равно не работает... Но товарищи с форума сборки, объяснили, что ошибка, которая меня возбудил, говорит об отсутствии файла, где прописаны функции... Вот кусок файла au3.properties

# Commands to compile / run your script
command.compile.*.au3=$(autoit3dir)\aut2exe\aut2exe.exe /in "$(FilePath)"
command.build.*.au3=$(autoit3dir)\aut2exe\aut2exe.exe /in "$(FilePath)"
command.go.*.au3=$(autoit3dir)\autoit3.exe "$(FilePath)"
# Tidy is a formatting program for Autoit 3 and can be downloaded from
# http://www.hiddensoft.com/fileman/users/jdeb/install_tidy.exe
command.9.*.au3=tidy\tidy.exe "$(FilePath)"
command.name.9.*.au3=Tidy AutoIt Source
command.save.before.9.*.au3=1
command.shortcut.9.*=Ctrl+9

# Standard LUA Functions
#extension.*.au3=$(SciteDefaultHome)\AutoIt3.lua
;extension.*.au3=$(SciteDefaultHome)\AutoItTools.lua
command.name.11.*.au3=MsgBox(4096,'debug',...)
command.subsystem.11.*.au3=3
command.11.*.au3=Debug_MsgBox
command.shortcut.11.*.au3=Ctrl+Shift+D
command.save.before.11.*.au3=2

command.name.12.*.au3=Insert Bookmarked Line(s)
command.subsystem.12.*.au3=3
command.12.*.au3=Copy_BookMarks
command.shortcut.12.*.au3=Ctrl+Shift+B
command.save.before.12.*.au3=2
#Пробный скрипт

command.name.13.*.au3=Мой пробный срипт
command.subsystem.13.*.au3=3
command.12.*.au3=dofile(props["SciteDefaultHome"]"\\tools\\1.lua")
command.shortcut.13.*.au3=Ctrl+Shift+V
command.mode.13.*au3=subsystem:lua,savebefore:no

Выделенные две строки указывают откуда будут браться функции для команд... Ставим вместо autoIt.lua autoItTools.lua и ошибка меняется вот на какую

C:\Program Files\AutoIt3\SciTE\tools\AutoItTools.lua:11: attempt to index global 'EventClass' (a nil value)

Она даже строку показывает, где данная ошибка... Может русская сборка не поддерживает указание классов в Lua?
Тут проблема на пересечении двух, так сказать, программ... С одной стороны язык lua с другой стороны построение интерфейса самого редактора SciTe.

Creat0R
01-05-2010, 04:19
товарищи с форума сборки, объяснили, что ошибка, которая меня возбудил, говорит об отсутствии файла, где прописаны функции »
Вот я про это же, нужен именно AutoIt3.lua, AutoItTools.lua это не то. И авторы этой сборки должны знать где это файл берётся, т.к в конфиге прописали его, а поместить видимо забыли.

Vlasssov
01-05-2010, 09:08
Вот я про это же, нужен именно AutoIt3.lua, AutoItTools.lua это не то. И авторы этой сборки должны знать где это файл берётся, т.к в конфиге прописали его, а поместить видимо забыли. »
На мой взгляд без разницы какой файл.. Проблема в интерпретаторе языка Lua.. Есть подозрение, что в русской сборке он просто объектную модель не поддерживает.

Creat0R
01-05-2010, 15:50
Проблема в интерпретаторе языка Lua.. Есть подозрение, что в русской сборке он просто объектную модель не поддерживает »
А что говорят авторы сборки по этому поводу?

Кстати, в обычном SciTE используются другие конструкции:

InvokeTool AutoItTools.DebugMsgBoxAdd
InvokeTool AutoItTools.Copy_BookMarks

Хотя вторая не распознаётся скриптами Lua что идут в SciTE для AutoIt.

Vlasssov
01-05-2010, 16:39
Хотя вторая не распознаётся скриптами Lua что идут в SciTE для AutoIt. »
Так в сборке AutoIT AutoItTools Представлены как объект, со всеми вытекающими.А что говорят авторы сборки по этому поводу? »
Молчат...

beve
02-05-2010, 01:25
нужен именно AutoIt3.lua »
AutoIt3.lua есть тута (http://zizanovic.com/files/php.lua), но он в русской SciTe отказывается работать.

Creat0R
02-05-2010, 02:15
AutoIt3.lua есть тута, но он в русской SciTe отказывается работать. »
Всё отлично работает, его нужно поместить в папку SciTE и убедится что в au3.properties прописан правильный путь: extension.*.au3=$(SciteDefaultHome)\AutoIt3.lua

И ещё, добавление MsgBox для отладки не совсем корректно работает, нужно заменить в этом AutoIt3.lua функцию Debug_MsgBox:

function Debug_MsgBox()
word = editor:GetSelText()
if string.len (word) == 0 then -- If no text is Selected yet then select current word.
word = _GetWord(1)
word = string.gsub(word, "\n", "") -- strip newline characters
word = string.gsub(word, "\r", "") -- strip carriage return characters
word = string.gsub(word, "%s", "") -- strip space characters
end
if string.len (word) == 0 then
_ALERT("Cursor not on any text.")
return
end
word2 = string.gsub(word, "'", "''") -- replace quote by 2 quotes
CurrentLine = editor:LineFromPosition(editor.CurrentPos) + 1
editor:Home()
editor:LineDown()
--editor:AddText("MsgBox(262144,'debug line ~" .. CurrentLine .. "' , \'" .. word2 .. "\:' & @lf & " .. word .. ") ;### Debug MSGBOX\r\n" )
--update from mhz
local option = tonumber(props['debug.msgbox.option'])
if option == 2 then
editor:AddText(tabs .. "MsgBox(262144,'Debug line ~" .. CurrentLine .. "','Selection:' & @lf & \'" .. word2 .. "\' & @lf & @lf & 'Return:' & @lf & " .. word .. " & @lf & @lf & '@Error:' & @lf & @Error & @lf & @lf & '@Extended:' & @lf & @Extended) ;### Debug MSGBOX\r\n" )
elseif option == 1 then
editor:AddText(tabs .. "MsgBox(262144,'Debug line ~" .. CurrentLine .. "','Selection:' & @lf & \'" .. word2 .. "\' & @lf & @lf & 'Return:' & @lf & " .. word .. " & @lf & @lf & '@Error:' & @lf & @Error) ;### Debug MSGBOX\r\n" )
elseif option == 0 then
editor:AddText(tabs .. "MsgBox(262144,'Debug line ~" .. CurrentLine .. "','Selection:' & @lf & \'" .. word2 .. "\' & @lf & @lf & 'Return:' & @lf & " .. word .. ") ;### Debug MSGBOX\r\n" )
elseif option == -1 then
editor:AddText(tabs .. "MsgBox(262144,'debug line ~" .. CurrentLine .. "' , \'" .. word2 .. "\:' & @lf & " .. word .. ") ;### Debug MSGBOX\r\n" )
else
editor:AddText("MsgBox(262144,'debug line ~" .. CurrentLine .. "' , \'" .. word2 .. "\:' & @lf & " .. word .. ") ;### Debug MSGBOX\r\n" )
end
--_ALERT("inserted debug msgbox.")
end

beve
02-05-2010, 19:32
Creat0R, спасибо за объяснение насчет функции Debug_MsgBox. Такой вопрос по lua:
Есть у меня файл MakeAbbrev.lua , вот код которого:
--[[-------------------------------------------------
MakeAbbrev.lua
Version: 1.5
Author: frs, mozers™
-------------------------------------------------
добавляем выделенный текст в аббревиатуры данного языка, задать аббревиатуру можно в диалоговом окне
-------------------------------------------------
Для подключения добавьте в свой файл au3.properties следующие строки:

# MakeAbbrev
extension.*.au3=$(SciteDefaultHome)\MakeAbbrev.lua
command.name.18.*.au3= Сохранить аббревиатуру
command.18.*.au3=SaveAbbr
#command.shortcut.18.*.au3=
command.subsystem.18.*.au3=3
command.save.before.18.*.au3=2

--]]-------------------------------------------------
-- Возвращает текущий символ перевода строки
local function GetEOL()
local eol = "\r\n"
if editor.EOLMode == SC_EOL_CR then
eol = "\r"
elseif editor.EOLMode == SC_EOL_LF then
eol = "\n"
end
return eol
end

function SaveAbbr()
local sel_text = editor:GetSelText()
if #sel_text < 1 then
print("!!! Чтобы сохранить аббревиатуру, выделите нужный фрагмент текста !!!")
return
end

if #sel_text < 10 then --ограничим минимум длины строки для аббревиатуры 10 символами
print("!!! Чтобы сохранить аббревиатуру, минимальная длина фрагмента текста должна быть не менее 10 символов !!!")
return
end

local title = scite.GetTranslation("Abbreviation")
local text = scite.GetTranslation("Enter abbreviation for code:")

local key = sel_text:match("%w+")
key = shell.inputbox(title, text, key, function(name) return not name:match('[# \t=]') end)
if key == nil then return end

local abbrev_file_text = ''
local abbrev_file = io.open(props["AbbrevPath"])
if abbrev_file then
abbrev_file_text = abbrev_file:read('*a').."\r"
abbrev_file:close()
end

io.output(props["AbbrevPath"])
sel_text = sel_text:gsub("\\","\\\\"):gsub(GetEOL(),"\\n"):gsub("\t","\\t")
io.write(abbrev_file_text..key.."="..sel_text)
io.close()
print("!!! Аббревиатура успешно сохранена, для ее вызова наберите в SciTe: "..key.." и нажмите клавишу пробел (Space) или Ctrl+B !!!")
end
При вызове этого файла, он в файл SciTe\abbrev\au3.abbrev, вот код которого:
# Global abbreviations file for SciTE
# Place this file in your home directory, that is, the same directory
# as the user options file.
# Contains a list of entries of the form abbreviation=expansion
# Type the abbreviation and press Ctrl+B to insert the expansion
# The '|' marke the position the caret will be after expansion.

#main=int main(int argc, char *argv[]) {\n|\n}
#i=if (|) {\n\n}
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#; Created by UpdateDefs (don't change anything between the dashed lines)
#------------------------------------------------------------
# ' Global abbreviations file for SciTE (au3.abbrev)'
# ' Contains a list of entries of the form abbreviation=expansion '
# ' Type the abbreviation and press Spacebar to insert the expansion '
# ' "|" marks the position the caret will be after expansion. '
# ' "\n" marks a carriage return. "\t" marks a Tab. '

#- 'A B B R E V I A T I O N S F O R A U T O I T F I N A L' -#

#; -- Files -- (use ctrl+b for this group)
au3check=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\SciTe\\Au3Check\\Au3Check.exe|
autoit3=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\AutoIt3.exe|
aut2exe=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\Aut2Exe\\Aut2Exe.exe|
datbeta=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\SciTe\\Defs\\unstable\\Au3Check\\au3check.dat|
datfinal=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\SciTe\\Defs\\Production\\Au3Check\\au3check.dat|
icon=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\Aut2Exe\\Icons\\|.ico
scite=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\SciTe\\SciTe.exe|

#; -- Directories -- (use ctrl+b for this group)
autoit3dir=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\|
aut2exedir=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\Aut2Exe\\|
icondir=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\Aut2Exe\\Icons\\|
includedir=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\Include\\|
scitedir=C:\\AutoIt_Versions\\AutoIt_3.3.0.0\\SciTe\\|

#; -- Variables --
chk=$Checkbox_|
edt=$Edit_|
inp=$Input_|
lbl=$Label_|
but=$Button_|
rad=$Radio_|
tab=$Tab_|

error=$Error |
result=$Result |

#; -- Constant GUICtrlRead --
gchecked=$GUI_CHECKED|
gunchecked=$GUI_UNCHECKED|

#; -- Constant GUICtrlState --
genable=$GUI_ENABLE|
gdisable=$GUI_DISABLE|
ghide=$GUI_HIDE|
gshow=$GUI_SHOW|
gfocus=$GUI_FOCUS|

#; -- Events and messages --
eclose=$GUI_EVENT_CLOSE|
emin=$GUI_EVENT_MINIMIZE|
erestore=$GUI_EVENT_RESTORE|
emax=$GUI_EVENT_MAXIMIZE|

#; -- PreSelected Commands --
cmd=RunWait(@ComSpec & ' /c |', '', @SW_HIDE)\n
slp1=Sleep(1000)\n|
slp2=Sleep(2000)\n|
slp3=Sleep(3000)\n|
slp4=Sleep(4000)\n|
slp5=Sleep(5000)\n|

#; -- GUI Common Prefixes to Functions --
gcc=GUICtrlCreate|
gcs=GUICtrlSet|

#; -- Macro's --
cr1=& @CRLF |
cr2=& @CRLF & @CRLF |
cr3=& @CRLF & @CRLF & @CRLF |
cr4=& @CRLF & @CRLF & @CRLF & @CRLF |
cr5=& @CRLF & @CRLF & @CRLF & @CRLF & @CRLF |
tab1=& @TAB |
tab2=& @TAB & @TAB |
tab3=& @TAB & @TAB & @TAB |
tab4=& @TAB & @TAB & @TAB & @TAB |
tab5=& @TAB & @TAB & @TAB & @TAB & @TAB |
lf1=& @LF |
lf2=& @LF & @LF |
lf3=& @LF & @LF & @LF |
lf4=& @LF & @LF & @LF & @LF |
lf5=& @LF & @LF & @LF & @LF & @LF |

#; -- Keywords --
cl=ContinueLoop|
el=ExitLoop|
err=@Error |
ext=@Extended |

#; -- Directives --
include=#include <GUIConstants.au3>\n|
includeonce=#include-once\n|
reg=#Region - |\n\n
ereg=#EndRegion\n\n|
nti=#NoTrayIcon\n\n|

#; -- Multiline Functions --
ifthen=If | Then\nEndIf
ifelse=If | Then\nElse\nEndIf
ifelseif=If | Then\nElseIf \nElse\nEndIf
dountil=Do\n\t|\nUntil
fornext=For $i = | To Step 1\nNext
fun=Func _|()\nEndFunc
selectcase=Select\n\n\tCase |\n\t\n\tCase \n\t\n\tCase \n\t\n\tCase \n\t\n\tCase Else \n\t\nEndSelect\n
more=|\n\n\tCase \n\t\t\n\tCase \n\n\tCase \n\n\tCase \n\n\tCase Else\t
whilewend=While |\nWEnd

#; -- Start of Functions --
for0=For $i = 0 To |
for0ub=For $i = 0 To UBound(|)
for1=For $i = 1 To |
for1ub=For $i = 1 To UBound(|)

#; -- GUI setup --
setupgui=#include <GUIConstants.au3>\n\n#Region - GUI Create\n\nGUICreate(|)\n\n#EndRegion\n\nGUISetState(@SW_SHOW)\n\nselectloop\n\nfunctions
selectloop=#Region - GUI SelectLoop\n\nWhile 1\n\t$msg = GUIGetMsg()\n\nSelect\n\n\tCase $msg = -3 ;$GUI_EVENT_CLOSE\n\tExit\n\n\tCase $msg = |\n\t\n\tCase $msg = \n\t\n\tCase $msg = \n\t\n\tCase $msg = \n\t\n\tCase $msg = \n\t\nEndSelect\n\nWEnd\n#EndRegion
moremsg=$msg = |\n\n\tCase $msg = \n\t\t\n\tCase $msg = \n\n\tCase $msg = \n\n\tCase $msg = \n\n\tCase $msg =\n\t
functions=; Start - Functions\n\nFunc _|A()\nEndFunc\n\nFunc _B()\nEndFunc\n\nFunc _C()\nEndFunc\n\nFunc _D()\nEndFunc\n\nFunc _E()\nEndFunc\n\nFunc _F()\nEndFunc\n\nFunc _G()\nEndFunc\n\nFunc _H()\nEndFunc\n\nFunc _I()\nEndFunc\n\nFunc _J()\nEndFunc

#; -- Special functions --
selfdelete=Func _SelfDelete()\n\tLocal $cmdfile\n\tFileDelete(@TempDir & "\scratch.cmd")\n\t$cmdfile = ':loop' & @CRLF _\n\t\t\t& 'del "' & @ScriptFullPath & '"' & @CRLF _\n\t\t\t& 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _\n\t\t\t& 'del ' & @TempDir & '\scratch.cmd'\n\tFileWrite(@TempDir & "\scratch.cmd", $cmdfile)\n\tRun(@TempDir & "\scratch.cmd", @TempDir, @SW_HIDE)\nEndFunc\n|

#; -- Compiler Directives + Options --
compiler=#Region - Compiler Directives\n\n#Compiler_Prompt = y\n#Compiler_AutoIt3 = \n#Compiler_Aut2Exe = \n#Compiler_Icon = \n#Compiler_OutFile =\n#Compiler_Compression = 2\n#Compiler_Allow_Decompile = y\n#Compiler_PassPhrase = \n#Compiler_Res_Comment = \n#Compiler_Res_Description = \n#Compiler_Res_Fileversion = 0.0.0.0\n#Compiler_Res_LegalCopyright = \n#Compiler_Res_Field = Platform\n#Compiler_Res_Field = AutoIt Version\n#Compiler_Run_AU3Check = y\n#Compiler_AU3Check_Dat = \n#Compiler_Run_Before = \n#Compiler_Run_After = \n#EndRegion\n\n
options=#Region - Options\n\n;~ Opt('CaretCoordMode', 0)\t\t\t; 1 = Absolute screen coordinates, 0 = Relative coords to the active window.\n;~ Opt('ColorMode', 1)\t\t\t\t; 0 = Colors are defined as RGB (0xRRGGBB), 1 = Colors are defined as BGR (0xBBGGRR).\n;~ Opt('ExpandEnvStrings', 1)\t\t; 0 = Don't expand, 1 = Do expand (Use %dos% variables in strings).\n;~ Opt('ExpandVarStrings', 1)\t\t; 0 = Don't expand, 1 = Do expand (Use $autoit$ variables in strings).\n;~ Opt('FtpBinaryMode', 0)\t\t\t; 1 = Binary transfer, 0 = ASCII transfer.\n;~ Opt('GUICloseOnESC', 0)\t\t\t; 1 = Send the $GUI_EVENT_CLOSE message when ESC is pressed (default).\n; \t\t\t\t\t\t\t\t\t 0 = Don't send the $GUI_EVENT_CLOSE message when ESC is pressed.\n;~ Opt('GUICoordMode', 2)\t\t\t; 1 = Absolute coordinates still relative to the dialog box.\n; \t\t\t\t\t\t\t\t\t 0 = Relative position to the start of the last control (Upper left corner).\n; \t\t\t\t\t\t\t\t\t 2 = Cell positionining relative to current cell.\n;~ Opt('GUIOnEventMode', 1)\t\t\t; 0 = Disable, 1 = Enable.\n;~ Opt('GUIResizeMode', 1)\t\t\t; 0 = No resizing, <1024 = Anytype of resizing (Reference: GuiCtrlSetResizing).\n;~ Opt('MouseClickDelay', 10)\t\t; ? = 10 milliseconds.\n;~ Opt('MouseClickDownDelay', 10)\t; ? = 10 milliseconds.\n;~ Opt('MouseClickDragDelay', 250)\t; ? = 250 milliseconds.\n;~ Opt('MouseCoordMode', 0)\t\t\t; 1 = Absolute, 0 = Relative to active window, 2 = Relative to client area.\n;~ Opt('MustDeclareVars', 1)\t\t; 0 = No, 1 = Require pre-declare.\n;~ Opt('OnExitFunc', '')\t\t\t; '' Sets the name of the function called when AutoIt exits (Default is OnAutoItExit).\n;~ Opt('PixelCoordMode', 0)\t\t\t; 1 = Absolute, 0 = relative, 2 = Relative coords to the client area.\n;~ Opt('RunErrorsFatal', 0)\t\t\t; 1 = Fatal, 0 = Silent set @error.\n;~ Opt('SendAttachMode', 1)\t\t\t; 0 = Don't attach, 1 = Attach.\n;~ Opt('SendCapslockMode', 0)\t\t; 1 = Store and restore, 0 = Don't store/restore.\n;~ Opt('SendKeyDelay', 5)\t\t\t; ? = 5 milliseconds.\n;~ Opt('SendKeyDownDelay', 1)\t\t; ? = 1 millisecond.\n;~ Opt('TrayIconDebug', 1)\t\t\t; 0 = No info, 1 = Debug line info.\n;~ Opt('TrayIconHide', 1)\t\t\t; 0 = Show, 1 = Hide.\n;~ Opt('WinDetectHiddenText', 1)\t; 0 = Don't detect, 1=Do detect.\n;~ Opt('WinSearchChildren', 1)\t\t; 0 = No, 1 = Search children also.\n;~ Opt('WinTextMatchMode', 4)\t\t; 1 = Complete / Slow mode, 2 = Quick mode.\n;~ Opt('WinTitleMatchMode', 4)\t\t; 1 = Start, 2 = SubString, 3 = Exact, 4 = ...\n;~ Opt('WinWaitDelay', 250)\t\t\t; ? = 250 milliseconds.\n#EndRegion\n\n

#; -- Templates --
setupudf=#Region - |\n\n;===============================================================================\n;\n; Description:\t\t:\n; Parameter(s):\t\t:\n; Requirement:\t\t:\n; Return Value(s):\t:\n; User CallTip:\t\t:\n; Author(s):\t\t:\n; Note(s):\t\t\t:\n;\n;=============================================================================== \n\n; Insert script here.\n#EndRegion\n\n

################ 'All Functions' ################

#; -- Misc Functions --
#~ abs
#~ acos
ad=AdlibDisable()|
ae=AdlibEnable(|)
#~ asc
#~ asin
as=Assign(|)
#~ atan
aso=AutoitSetOption(|)
awgt=AutoitWinGetTitle()|
awst=AutoitWinSetTitle(|)
ba=BitAND(|)
bn=BitNOT(|)
bo=BitOR(|)
bs=BitShift(|)
bx=BitXOR(|)
bi=BlockInput(|)
br=Break(|)
#~ call
cdt=CDTray(|)
#~ chr
cg=ClipGet()|
cp=ClipPut(|)
cw=ConsoleWrite(| & @LF)

#; -- Control Functions --
ccl=ControlClick(|)
cco=ControlCommand(|)
cd=ControlDisable(|)
ce=ControlEnable(|)
cf=ControlFocus(|)
cgf=ControlGetFocus(|)
cgh=ControlGetHandle(|)
cgp=ControlGetPos(|)
cgt=ControlGetText(|)
ch=ControlHide(|)
clv=ControlListView(|)
cm=ControlMove(|)
cs=ControlSend(|)
cst=ControlSetText(|)
csh=ControlShow(|)

#~ cos
#~ dec

#; -- Dir Functions --
dco=DirCopy(|)
dcr=DirCreate(|)
dgs=DirGetSize(|)
dm=DirMove(|)
dr=DirRemove(|)

dll=DllCall(|)
dllc=DllClose(|)
dllo=DllOpen(|)

#; -- Drive Functions --
dgd=DriveGetDrive(|)
dgfs=DriveGetFileSystem(|)
dgl=DriveGetLabel(|)
dgs=DriveGetSerial(|)
dgt=DriveGetType(|)
dma=DriveMapAdd(|)
dmd=DriveMapDel(|)
dmg=DriveMapGet(|)
dsl=DriveSetLabel(|)
dsf=DriveSpaceFree(|)
dst=DriveSpaceTotal(|)
ds=DriveStatus(|)

eg=EnvGet(|)
es=EnvSet(|)
eu=EnvUpdate()|
#~ eval
#~ exp

#; -- File Functions --
fcd=FileChangeDir(|)
fcl=FileClose(|)
fco=FileCopy(|)
fcs=FileCreateShortcut(|)
fd=FileDelete(|)
fe=FileExists(|)
ffff=FileFindFirstFile(|)
ffnf=FileFindNextFile(|)
fga=FileGetAttrib(|)
fgln=FileGetLongName(|)
fgs=FileGetShortcut(|)
fgsn=FileGetShortName(|)
fgsi=FileGetSize(|)
fgt=FileGetTime(|)
fgv=FileGetVersion(|)
fi=FileInstall(|)
fm=FileMove(|)
fo=FileOpen(|)
fod=FileOpenDialog(|)
fr=FileRead(|)
frl=FileReadLine(|)
frc=FileRecycle(|)
frce=FileRecycleEmpty(|)
fsd=FileSaveDialog(|)
fsf=FileSelectFolder(|)
fsa=FileSetAttrib(|)
fst=FileSetTime(|)
fw=FileWrite(|)
fwl=FileWriteLine(|)

fsp=FtpSetProxy(|)

#; -- GUI Functions --
gc=GUICreate(|)
gcca=GUICtrlCreateAvi(|)
gccb=GUICtrlCreateButton(|)
gcccb=GUICtrlCreateCheckbox(|)
gccc=GUICtrlCreateCombo(|)
gcccm=GUICtrlCreateContextMenu(|)
gccda=GUICtrlCreateDate(|)
gccdu=GUICtrlCreateDummy()|
gcce=GUICtrlCreateEdit(|)
gccg=GUICtrlCreateGroup(|)
gccgc=GUICtrlCreateGroup('', -99, -99, 1, 1) ; Close group.\n|
gccico=GUICtrlCreateIcon(|)
gcci=GUICtrlCreateInput(|)
gccla=GUICtrlCreateLabel(|)
gccli=GUICtrlCreateList(|)
gccm=GUICtrlCreateMenu(|)
gccmi=GUICtrlCreateMenuItem(|)
gccpi=GUICtrlCreatePic(|)
gccpr=GUICtrlCreateProgress(|)
gccr=GUICtrlCreateRadio(|)
gccs=GUICtrlCreateSlider(|)
gcct=GUICtrlCreateTab(|)
gccti=GUICtrlCreateTabItem(|)
gcctic=GUICtrlCreateTabItem('') ; Close tabitem.\n|
gcctv=GUICtrlCreateTreeView(|)
gcctvi=GUICtrlCreateTreeViewItem(|)
gccu=GUICtrlCreateUpdown(|)
gcd=GUICtrlDelete(|)
gcgs=GUICtrlGetState(|)
gcr=GUICtrlRead(|)
gcrm=GUICtrlRecvMsg(|)
gcsm=GUICtrlSendMsg(|)
gcstd=GUICtrlSendToDummy(|)
gcsbc=GUICtrlSetBkColor(|)
gcsco=GUICtrlSetColor(|)
gcscu=GUICtrlSetCursor(|)
gcsd=GUICtrlSetData(|)
gcsf=GUICtrlSetFont(|)
gcsi=GUICtrlSetImage(|)
gcsl=GUICtrlSetLimit(|)
gcsoe=GUICtrlSetOnEvent(|)
gcsp=GUICtrlSetPos(|)
gcsr=GUICtrlSetResizing(|)
gcss=GUICtrlSetState(|)
gcsst=GUICtrlSetStyle(|)
gcst=GUICtrlSetTip(|)
gd=GUIDelete(|)
ggci=GUIGetCursorInfo(|)
ggm=GUIGetMsg(|)
gsbc=GUISetBkColor(|)
gsc=GUISetCoord(|)
gscu=GUISetCursor(|)
gsf=GUISetFont(|)
gsh=GUISetHelp(|)
gsi=GUISetIcon(|)
gsoe=GUISetOnEvent(|)
gss=GUISetState(|)
gsg=GUIStartgroup(|)
gs=GUISwitch(|)

#~ hex
hks=HotKeySet(|)
hsp=httpSetProxy(|)
ig=InetGet(|)
igs=InetGetSize(|)

id=IniDelete(|)
ir=IniRead(|)
irs=IniReadSection(|)
irsn=IniReadSectionNames(|)
iw=IniWrite(|)

ib=InputBox(|)

#~ int
isad=IsAdmin()|
isar=IsArray(|)
isd=IsDeclared(|)
isf=IsFloat(|)
isi=IsInt(|)
isn=IsNumber(|)
iss=IsString(|)
#~ log
mgs=MemGetStats()|
#~ mod

#; -- Mouse Functions --
mc=MouseClick(|)
mcd=MouseClickDrag(|)
md=MouseDown(|)
mgc=MouseGetCursor()|
mgp=MouseGetPos()|
mm=MouseMove(|)
MB=MsgBox(48,"Test","|")
mu=MouseUp(|)
mw=MouseWheel(|)

mb=MsgBox(64, 'Title', |)
mbx=MsgBox(64, 'Title', |)
num=Number(|)
#~ opt
#~ ping
pcs=PixelChecksum(|)
pgc=PixelGetColor(|)
ps=PixelSearch(|)

#; -- Process Functions --
pc=ProcessClose(|)
pe=ProcessExists(|)
pl=ProcessList(|)
psp=ProcessSetPriority(|)
pw=ProcessWait(|)
pwc=ProcessWaitClose(|)

poff=ProgressOff()|
pon=ProgressOn(|)
pset=ProgressSet(|)

rdm=Random(|)
rd=RegDelete(|)
rek=RegEnumKey(|)
rev=RegEnumVal(|)

rr=RegRead(|)
rw=RegWrite(|)

rnd=Round(|)

#~ run
ras=RunAsSet(|)
rwa=RunWait(|)

#~ send

se=SetError(|)
sex=SetExtended(|)
sd=Shutdown(|)
#~ sin

slp=Sleep(|)

sp=SoundPlay(|)
sswv=SoundSetWaveVolume(|)

sio=SplashImageOn(|)
so=SplashOff()|
sto=SplashTextOn(|)

#~ sqrt
sbgt=StatusbarGetText(|)

#; -- String Functions --
stri=String(|)
sacr=StringAddCR(|)
sf=StringFormat(|)
sis=StringInStr(|)
sian=StringIsAlNum(|)
sia=StringIsAlpha(|)
siascii=StringIsASCII(|)
sid=StringIsDigit(|)
sif=StringIsFloat(|)
sii=StringIsInt(|)
sil=StringIsLower(|)
sisp=StringIsSpace(|)
siu=StringIsUpper(|)
sixd=StringIsXDigit(|)
sl=StringLeft(|)
slen=StringLen(|)
slower=StringLower(|)
sm=StringMid(|)
srep=StringReplace(|)
sr=StringRight(|)
ss=StringSplit(|)
sscr=StringStripCR(|)
ssws=StringStripWS(|)
stl=StringTrimLeft(|)
str=StringTrimRight(|)
supper=StringUpper(|)

#; -- Misc Functions --
#~ tan
td=TimerDiff(|)
ti=TimerInit()|
toolt=ToolTip(|)

#; -- Tray Functions --
tt=TrayTip(|)

ub=UBound(|)

#; -- Window Functions --
wat=WinActivate(|)
wa=WinActive(|)
wc=WinClose(|)
we=WinExists(|)
wgcp=WinGetCaretPos()|
wgcl=WinGetClassList(|)
wgcs=WinGetClientSize(|)
wgh=WinGetHandle(|)
wgpo=WinGetPos(|)
wgpr=WinGetProcess(|)
wgs=WinGetState(|)
wgte=WinGetText(|)
wgti=WinGetTitle(|)
wk=WinKill(|)
wl=WinList(|)
wmsi=WinMenuSelectItem(|)
wma=WinMinimizeAll()|
wmau=WinMinimizeAllUndo()|
wm=WinMove(|)
wrapper=#Region AutoIt3Wrapper directives section\n;~#AutoIt3Wrapper_Res_Comment=\n;~#AutoIt3Wrapper_Res_Description=\n;~#AutoIt3Wrapper_Res_F ileversion=\n;~#AutoIt3Wrapper_Res_Language=\n;~#AutoIt3Wrapper_Res_LegalCopyright=\n\n;** AUT2EXE settings\n;~#AutoIt3Wrapper_Icon= ;Filename of the Ico file to use\n;~#AutoIt3Wrapper_OutFile= ;Target exe/a3x filename.\n;~#AutoIt3Wrapper_OutFile_Type= ;a3x=small AutoIt3 file; exe=Standalone executable (Default)\n;~#AutoIt3Wrapper_Compression= ;Compression parameter 0-4 0=Low 2=normal 4=High. Default=2\n;~#AutoIt3Wrapper_UseUpx= ;(Y/N) Compress output program. Default=Y \n;~#AutoIt3Wrapper_Change2CUI= ;(Y/N) Change output program to CUI in stead of GUI. Default=N\n#EndRegion\n|
wsot=WinSetOnTop(|)
wss=WinSetState(|)
wst=WinSetTitle(|)
wstr=WinSetTrans(|)
ww=WinWait(|)
wwa=WinWaitActive(|)
wwc=WinWaitClose(|)
wwna=WinWaitNotActive(|)
gui=#include <GUIConstantsEx.au3>\nGlobal $msg\nGUICreate("My GUI") ; will create a dialog box that when displayed is centered\nGUISetState(@SW_SHOW) ; will display an empty dialog box\n\n; Run the GUI until the dialog is closed\nWhile 1\n\t$msg = GUIGetMsg()\n\t\tIf $msg = $GUI_EVENT_CLOSE Then ExitLoop\nWEnd\nGUIDelete()
inc=#include <|.au3>
в конец файла, добавляет строчку, key.."="..sel_text - это переменные из файла MakeAbbrev.lua в которых хранятся данные что вводятся ранее, на самом деле может быть, например этим cw=ConsoleWrite(| & @LF). У меня такой вопрос, как можно переделать файл MakeAbbrev.lua, чтоб он добавлял и в файл au3.keywords.abbreviations.properties, который находится в той же папке, что и файл au3.abbrev (в файле описаны аббревиатуры, при вводе которых в SciTe - они подсвечиваются красным цветом, если какая то аббревиатура не будет сдесь прописана, а только в файле: au3.abbrev, - подсвечиваться красным цветом она не будет, что не практично), так вот, как в файл au3.keywords.abbreviations.properties добавить аббревиатуру, которая находися в переменной из файла MakeAbbrev.lua - key?, структура файла au3.keywords.abbreviations.properties такова:

au3.keywords.abbrev=gui inc MB wrapper but chk edt inp lbl rad tab item hnd regkey regval regdat error result gchecked gunchecked \
genable gdisable ghide gshow gfocus eclose emin erestore emax cmd cmd2 mb2 slp1 slp2 slp3 \
slp4 slp5 gcc gcs cr1 cr2 cr3 cr4 cr5 tab1 tab2 tab3 tab4 tab5 lf1 lf2 lf3 lf4 lf5 cc cl \
el err ext include includeonce reg ereg nti ifthen ifelse ifelseif dountil fornext fun \
selectcase switchcase more whilewend withendwith for0 for0ub for1 for1ub setupgui setupre selectloop \
switchloop moremsg functions say selfdelete compiler compiler2 a3w a3w2 options setupudf \
cmdline cmdlineselect cmdlineselect2 cmdlineswitch cmdlineswitch2 aes ael raes rwaes rael \
rwael ad ae as aso awgt awst ba bi bin binl binm bn bo bro bre bs bx ccl cco cd cdt ce \
ceil cf cg cgf cgh cgp cgt ch clv cm cp cr cs csh cst cw cwe dco dcr dgd dgfs dgl dgsi \
dgse dgt dll dllc dllo dllsc dllsgd dllsgp dllsgs dllssd dm dma dmd dmg dr ds dsf dsl dst \
eg es eu exec fcd fcl fcnl fco fcs fd fe ffff ffnf fga fgln fgsh fgsi fgsn fgt fgv fi flo \
fm fo fod fr frc frce frl fsa fsd fsf fsp fst fw fwl gc gcca gccb gcccb gcccm gccda gccdu \
gcce gccg gccgc gccgr gcci gccico gccla gccli gccm gccmc gccmi gccco gcco gccpi gccpr gccr \
gccs gcct gccti gcctic gcctv gcctvi gccu gcd gcgh gcgs gcr gcrlvs gcrm gcsbc gcsco gcscu \
gcsd gcsf gcsgr gcsi gcsl gcsm gcsoe gcsp gcsr gcss gcsst gcst gcstd gd ggci ggm grm gs \
gsa gsbc gsc gscu gsf gsg gsh gsi gsoe gss gsw hks hsp ib id ig igs ir irs irsn isad isar \
isbin isbo isd isf ishw isi isk isn iso iss iw iws mb mbx mc mcd md mgc mgp mgs mm mu mw num \
oae oas ocr oev oge pc pcs pe pgc pic pio pl poff pon ps pset psp pw pwc ra raw rd rdm \
rek rev rnd rr rwa rwr sacr sbgt sco sd se ser sex sexec sexecw sf sia sian siascii sid \
sif sii sil sio sioc sis sisp siu siw sixd ska sl slen slower slp sm so sor sp sr srep \
srex srexr ss sscr ssws sswv stbin stl sto str stri supper tci tcm tcpa tcpc tcpcs tcpl \
tcpntip tcpr tcps tcpsd tcpsu td tgm ti tid tigh tigs tigt tisoe tiss tist toolt tsc tsi \
tsoe tspi tss tstt tt ub udpb udpcs udpo udpr udpsd udpsu wa wat wc we wf wgcl wgcp wgcs \
wgh wgpo wgpr wgs wgte wgti wk wl wm wma wmau wmsi wsot wss wst wstr ww wwa wwc wwna

P.S. Кстати, благодаря файлу AutoIt3.lua, инициализацию которого нужно прописать в \SciTe\tools\SciTEStartup.lua аббревиатуры вставляются уже по нажатию на пробел.

beve
02-05-2010, 22:47
Сам решил, примерно так получилось содержимое файла MakeAbbrev.lua:
--[[-------------------------------------------------
MakeAbbrev.lua
Version: 1.5
Author: frs, mozers™
-------------------------------------------------
добавляем выделенный текст в аббревиатуры данного языка, задать аббревиатуру можно в диалоговом окне
-------------------------------------------------
Для подключения добавьте в свой файл .properties следующие строки:

# MakeAbbrev
extension.*.au3=$(SciteDefaultHome)\MakeAbbrev.lua
command.name.18.*.au3= Сохранить аббревиатуру
command.18.*.au3=SaveAbbr
#command.shortcut.18.*.au3=
command.subsystem.18.*.au3=3
command.save.before.18.*.au3=2

--]]-------------------------------------------------
-- Возвращает текущий символ перевода строки
local function GetEOL()
local eol = "\r\n"
if editor.EOLMode == SC_EOL_CR then
eol = "\r"
elseif editor.EOLMode == SC_EOL_LF then
eol = "\n"
end
return eol
end

function SaveAbbr()
local sel_text = editor:GetSelText()
if #sel_text < 1 then
print("!!! Чтобы сохранить аббревиатуру, выделите нужный фрагмент текста !!!")
return
end

if #sel_text < 10 then --ограничим минимум длины строки для аббревиатуры 10 символами
print("!!! Чтобы сохранить аббревиатуру, минимальная длина фрагмента текста должна быть не менее 10 символов !!!")
return
end

local title = scite.GetTranslation("Abbreviation")
local text = scite.GetTranslation("Enter abbreviation for code:")

local key = sel_text:match("%w+")
key = shell.inputbox(title, text, key, function(name) return not name:match('[# \t=]') end)
if key == nil then return end

local abbrev_file_text = ''
local abbrev_file = io.open(props["AbbrevPath"])
if abbrev_file then
abbrev_file_text = abbrev_file:read('*a').."\r"
abbrev_file:close()
end

-----------------------------------------------------------------------------------------------------
local abbreviations_file_text = ''
local abbreviations_file = io.open("D:\\Programs\\AutoIt_v3.3.6.0\\SciTe\\abbrev\\au3.keywords.abbreviations.properties")
if abbreviations_file then

abbreviations_file_text = abbreviations_file:read('*a').." "
abbreviations_file:close()

io.output("D:\\Programs\\AutoIt_v3.3.6.0\\SciTe\\abbrev\\au3.keywords.abbreviations.properties")
io.write(abbreviations_file_text..key)
io.close()
else
print("!!! Не найден файл: au3.keywords.abbreviations.properties")
end

-----------------------------------------------------------------------------------------------------
io.output(props["AbbrevPath"])
sel_text = sel_text:gsub("\\","\\\\"):gsub(GetEOL(),"\\n"):gsub("\t","\\t")
io.write(abbrev_file_text..key.."="..sel_text)
io.close()

io.output("D:\\Programs\\AutoIt_v3.3.6.0\\SciTe\\home\\abbrev.properties")
io.write(abbrev_file_text..key.."="..sel_text)
io.close()
print("!!! Аббревиатура успешно сохранена, для ее вызова наберите в SciTe: "..key.." и нажмите клавишу пробел (Space) или Ctrl+B !!!")
end
Но неувязочка осталась некоторая, все добавляется правильно, но не подсвечиваются аббревиатуры введенные таким образом красным цветом и нет реакции при нажатии на пробел, хотя если вручную тоже самое добавить в указанные файлы - все точно также точь в точь, - все подсвечивается и есть реакция на пробел, а в данном случае - только по нажатию на CTRL+B идет расшифровка введенной аббревиатуры.




© OSzone.net 2001-2012