AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scripts discussion (2)
Goto page Previous  1, 2, 3 ... 89, 90, 91 ... 94, 95, 96  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    AkelPad Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
KDJ



Joined: 06 Mar 2010
Posts: 1321
Location: Poland

PostPosted: Sun Mar 23, 2014 5:01 pm    Post subject: Reply with quote

Instructor wrote:
KDJ
User requesting replace in files. Maybe add replace field and replace button in FindFiles.js script?

I could try to do it. According to the following algorithm:
Code:
nDetectFile = AkelPad.SendMessage(hMainWnd, 1177 /*AKD_DETECTFILEW*/, 0, lpDETECTFILE);
if ((nDetectFile == 0 /*EDT_SUCCESS*/) || (nDetectFile == -4 /*EDT_BINARY*/))
{
  nCodePage = AkelPad.MemRead(lpDETECTFILE...);
  bBOM      = AkelPad.MemRead(lpDETECTFILE...);
  sContent  = AkelPad.ReadFile(sFileName, 0, nCodePage, bBOM);
  if (oRegExp.test(sContent)
  {
    sContent = sContent.replace(oRegExp...);
    AkelPad.WriteFile(sFileName, sContent, nCodePage, bBOM);
  }
}

I miss only the method AkelPad.WriteFile(). Sad
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1321
Location: Poland

PostPosted: Sun Mar 23, 2014 8:38 pm    Post subject: Reply with quote

AkelPadMethodsView.js
Changed: Find ignore case by default.
Added: parameter "Find - match case". To set it, press "Menu" button (F1).

Instructor
I can't login to: http://akelpad.sourceforge.net/files/plugs/Scripts/.Upload.html
Is the password has been changed?
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1321
Location: Poland

PostPosted: Mon Mar 24, 2014 6:29 pm    Post subject: Reply with quote

AkelPadDocsView.js
Added: parameter "Find - match case" in menu.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5289

PostPosted: Tue Mar 25, 2014 11:46 am    Post subject: Reply with quote

KDJ wrote:
I can't login to: http://akelpad.sourceforge.net/files/plugs/Scripts/.Upload.html
Now should work. Permission restrictions.
Back to top
View user's profile Send private message Send e-mail
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5289

PostPosted: Tue Mar 25, 2014 5:17 pm    Post subject: Reply with quote

KDJ wrote:
I miss only the method AkelPad.WriteFile().
4.8.8 Dev and Scripts v14.4
Back to top
View user's profile Send private message Send e-mail
yozhic



Joined: 20 Jun 2011
Posts: 42
Location: Электросталь

PostPosted: Thu Mar 27, 2014 8:05 am    Post subject: Reply with quote

Отчёт о подрывных действиях пользователя.
AkelPad 4.8.7, Scripts.dll 14.3, Restart.js 0.1.1
Code:
  -"Restart AkelPad session" Call("Scripts::Main", 1, "Restart.js", '-nirCmd="%a\..\..\utils\ConsoleX\nircmd.exe" -session="OnExit" -sessionAutoload=false')

Если во время рестарта открыты диалог Replace и диалог SearchReplace.js, AkelPad падает... Добавлено: при одном открытом SearchReplace.js тоже падает.
Системный отчёт

Problem signature:
Problem Event Name: APPCRASH
Application Name: AkelPad.exe
Application Version: 4.8.7.0
Application Timestamp: 52ee3cb1
Fault Module Name: Scripts.dll
Fault Module Version: 14.3.0.0
Fault Module Timestamp: 532de848
Exception Code: c0000005
Exception Offset: 000011b4
OS Version: 6.3.9600.2.0.0.256.4
Locale ID: 1033
Additional Information 1: 5861
Additional Information 2: 5861822e1919d7c014bbb064c64908b2
Additional Information 3: 2af1
Additional Information 4: 2af1ed6f1bdf9836b314522e3dfa0012
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5289

PostPosted: Fri Mar 28, 2014 7:49 pm    Post subject: Reply with quote

Infocatcher
У меня, если строки не заданы в указанном порядке, то перезапуск происходит в 2-х случаях из 3-х. Для еще большей надежности можно и небольшой Sleep поставить, но у меня и так работает.
restart.js wrote:
AkelPad.Exec(cmd, akelDir);
AkelPad.Command(4109); // Exit


yozhic
Исправлено. Будет доступно после релиза AkelPad 4.8.8.
Back to top
View user's profile Send private message Send e-mail
Infocatcher



Joined: 06 Aug 2007
Posts: 1590

PostPosted: Fri Mar 28, 2014 8:37 pm    Post subject: Reply with quote

Instructor wrote:
Infocatcher
У меня, если строки не заданы в указанном порядке, то перезапуск происходит в 2-х случаях из 3-х. Для еще большей надежности можно и небольшой Sleep поставить, но у меня и так работает.
restart.js wrote:
AkelPad.Exec(cmd, akelDir);
AkelPad.Command(4109); // Exit
А у меня – наоборот. Если передвинуть выход в конец, то периодически падает (но и перезапускается).
Причем я сделал
Code:
AkelPad.Exec(cmd, akelDir);
WScript.Sleep(1000);
AkelPad.Command(4109); // Exit

И падает еще до выхода.

P.S. Отправил папку с AkelPad'ом.
Back to top
View user's profile Send private message
Infocatcher



Joined: 06 Aug 2007
Posts: 1590

PostPosted: Sat Mar 29, 2014 11:12 am    Post subject: Reply with quote

С разрабатываемыми версиями AkelPad'а и Scripts, вроде, все нормально, обновляю:
restart.js
Reorder commands to prevent crashes
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1321
Location: Poland

PostPosted: Sat Mar 29, 2014 10:49 pm    Post subject: Reply with quote

Instructor wrote:
KDJ wrote:
I miss only the method AkelPad.WriteFile().
4.8.8 Dev and Scripts v14.4

It seems to me that AkelPad.WriteFile() does not work for NTFS streams.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5289

PostPosted: Sun Mar 30, 2014 5:29 am    Post subject: Reply with quote

KDJ
Not reproduced. Next code works correctly:
Code:
AkelPad.WriteFile("C:\\File.txt:123", "Text", -1, 65001, true);
WScript.Echo(AkelPad.ReadFile("C:\\File.txt:123"));
AkelPad.OpenFile("C:\\File.txt:123");
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1321
Location: Poland

PostPosted: Sun Mar 30, 2014 12:07 pm    Post subject: Reply with quote

Instructor
I think I know where the error is. After writing in the file (main stream), disappearing alternate streams. Test code:
Code:
AkelPad.WriteFile("C:\\File.txt", "File text", -1, 65001, true);
WScript.Echo(AkelPad.ReadFile("C:\\File.txt"));

AkelPad.WriteFile("C:\\File.txt:Stream", "Stream text", -1, 65001, true);
WScript.Echo(AkelPad.ReadFile("C:\\File.txt:Stream"));

AkelPad.WriteFile("C:\\File.txt", "File text changed", -1, 65001, true);
WScript.Echo(AkelPad.ReadFile("C:\\File.txt"));
WScript.Echo(AkelPad.ReadFile("C:\\File.txt:Stream")); //Stream not exists

Maybe you should change dwCreationDisposition parameter in CreateFile() function, instead of CREATE_ALWAYS:
if file/stream exists
dwCreationDisposition = TRUNCATE_EXISTING
else
dwCreationDisposition = CREATE_NEW
Back to top
View user's profile Send private message
Infocatcher



Joined: 06 Aug 2007
Posts: 1590

PostPosted: Sun Mar 30, 2014 5:08 pm    Post subject: Reply with quote

insertTag.js
Treat typed tag as template, if it contains %x variable
Correctly update caret after insert
Back to top
View user's profile Send private message
Infocatcher



Joined: 06 Aug 2007
Posts: 1590

PostPosted: Wed Apr 02, 2014 7:46 am    Post subject: Reply with quote

Что-то у меня на разрабатываемых версиях стало падать при использовании winMergeTabs.js: вкладка выбирается без проблем, а вот где-то в районе запуска внешней программы периодически падает (хотя чаще падает, чем нет, подробностей почему-то в логи не пишет).
AkelPad.exe v.4.8.8dev (388 096 байт, CRC32: 2dfdd955, MD5: 348c5d66dc579882a20bc2662b7610a0)
Scripts.dll v.14.5 (77 312 байт, CRC32: cab1f40b, MD5: 369189408be72be5306211d08d63ed8a)

Хм, хотя вот и с tileTabs.js тоже падает.

Upd:
Вот такое помогает:
Code:
   if(uMsg == 0x416 /*AKDN_FRAME_ACTIVATE*/) {
      if(lParam != lpFrame) {
         lpFrame2 = lParam;
         WScript.Sleep(50); //!
         oSys.Call("user32::PostQuitMessage", 0); // Exit message loop
      }
   }


Last edited by Infocatcher on Wed Apr 02, 2014 7:52 am; edited 1 time in total
Back to top
View user's profile Send private message
DV



Joined: 16 Nov 2006
Posts: 829
Location: Kyiv, Ukraine

PostPosted: Wed Apr 02, 2014 12:45 pm    Post subject: Reply with quote

Задачка такого плана:
Есть некое консольное приложение, выводящее в результате своей работы в консоль путь к некоторому файлу.
Хочется вот чего: из работающего AkelPad запустить это приложение по-тихому, вычитать возвращаемое имя файла и открыть этот файл в AkelPad.
С помощью скрипта я запросто могу запустить это консольное приложение, даже могу вывести возвращаемое имя файла в Log::Output. Но как автоматизировать получение имени файла из вывода (output) консольного приложения?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    AkelPad Forum Index -> Plugins All times are GMT
Goto page Previous  1, 2, 3 ... 89, 90, 91 ... 94, 95, 96  Next
Page 90 of 96

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group