Leaderboard
Popular Content
Showing content with the highest reputation on 08/04/2016 in all areas
-
write/execute/return output from bash
argumentum reacted to JLogan3o13 for a topic
Google is your friend: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=bash for windows1 point -
So that for you but how many other will ask to fit the X11 .. We don't want to add so many color It is the user responsability to add them in their scripts1 point
-
OOo/LibO Calc UDF
argumentum reacted to GMK for a topic
64-bit update: I just upgraded to LibreOffice 5.2.0.4 x64 and it seems to work fine better. I'm still trying to get SaveAs to work properly. @keafter, I'll check out your error and see what I can find. What version of OO/LO are you running?1 point -
1 point
-
Your first example is how I would typically handle this. However, if you look closely, the onclick is defined on the contained input element, not on the span. You need to get the xpath for that element and then call the onclick method.1 point
-
https://www.autoitscript.com/autoit3/docs/libfunctions/_FileListToArray.htm and for stringinstr check on greater than 0. Exact match on 136 is risky if string is at other position.1 point
-
HTML editor
argumentum reacted to trancexx for a topic
Let me see if I can find it somewhere. It was really 100 years ago. I'm also interested to see if I was any good back then, LOL. I might need supergirl powers for this. Oh look, it's a link! Go figure.1 point -
Simple Logging UDF - Log.au3 based on log4j / NLog
user4157124 reacted to jvanegmond for a topic
This is a logging library for AutoIt. This library allows you to log messages with different log levels. The log levels are $LOG_TRACE, $LOG_DEBUG, $LOG_INFO, $LOG_WARN, $LOG_ERROR, $LOG_FATAL. These levels are described on the Log4j Wikipedia page. Each message is logged to the console (ConsoleWriteError for $LOG_ERROR and $LOG_FATAL and ConsoleWrite for all other levels) and to a file. You can choose the filename and a directory (see LogFile), but if you don't the log file will be in the same directory as the program and called @ScriptName & ".log". You can also choose to disable logs below a certain log level (see LogLevel). You can also completely customize the format of the log text (see LogFormat). log.au3 Here's an example on how to use this library: #include <log.au3> LogTrace("This is an example trace message") LogDebug("This is an example debug message") LogInfo("This is an example info message") LogWarn("This is an example warning message") LogError("This is an example error message") LogFatal("This is an example fatal message") The output looks like this: [2014-08-13 21:06:50.582 TRACE] This is an example trace message [2014-08-13 21:06:50.582 DEBUG] This is an example debug message [2014-08-13 21:06:50.582 INFO ] This is an example info message [2014-08-13 21:06:50.582 WARN ] This is an example warning message [2014-08-13 21:06:50.591 ERROR] This is an example error message [2014-08-13 21:06:50.591 FATAL] This is an example fatal message Additionally, these functions are available for your convenience: LogFile($sFileName) #include <log.au3> LogFile("C:\example.log") LogInfo("This is an example info message") and the output will appear on the C: drive in a file called example.log. LogLevel($iMinLevel) #include <log.au3> LogLevel($LOG_INFO) LogTrace("This is an example trace message and it will not appear in the logs") LogInfo("This is an example info message and it will appear in the logs") LogFatal("This is an example fatal message and it will appear in the logs") The LogTrace call will have no effect. Only the LogInfo and LogFatal message will appear in the log. LogStart() #include <log.au3> LogStart() LogInfo("This is an example info message") Output: [2014-08-13 21:14:42.886 INFO ] C:\Users\jvanegmond\Desktop\example.au3 started. [2014-08-13 21:14:42.888 INFO ] This is an example info message LogFormat($fFormatFunc) #include <log.au3> LogFormat(MyLogFormat) LogTrace("This is an example trace message") LogDebug("This is an example debug message") LogInfo("This is an example info message") LogWarn("This is an example warning message") LogError("This is an example error message") LogFatal("This is an example fatal message") Func MyLogFormat($sLevel, $sMessage) Return @HOUR & ":" & @MIN & ":" & @SEC & " " & StringStripWS($sLevel, 8) & " " & $sMessage EndFunc Shows the output: 11:39:52 TRACE This is an example trace message 11:39:52 DEBUG This is an example debug message 11:39:52 INFO This is an example info message 11:39:52 WARN This is an example warning message 11:39:52 ERROR This is an example error message 11:39:52 FATAL This is an example fatal message Please let me know what I can remove from this library so that it can fit your use-case better. Edit: Changes: v1.2 Support for log format v1.1 Create directory structure for log file v1.0 Initial release1 point -
Simple Logging UDF - Log.au3 based on log4j / NLog
Tankbuster reacted to Bowmore for a topic
The following is a method I use to trim data from the beginning of log files. Just call as often as required. NOTE: If you keep a handle to your log while you script is running then you will need to close the file before closing this function and reopen it after it has been trimmed. #include <FileConstants.au3> TrimLogFile($sFilename, 20000) Func TrimLogFile($sFilename, $iMaxSize = 50000) Local $iSize = FileGetSize($sFilename) Local $hFile = -1 Local $sData = '' If $oSize > $iMaxSize Then $hFile = FileOpen($sFilename) If @error Then Return SetError(1, 0, 0) FileSetPos($h, -$iMaxSize, $FILE_END) If @error Then Return SetError(2, 0, 0) $sData = FileRead($hFile) If @error Then Return SetError(2, 0, 0) FileClose($hFile) $hFile = FileOpen($sFilename, $FO_OVERWRITE) FileWrite($hFile, $sData) FileClose($hFile) EndIf Return FileGetSize($sFilename) EndFunc ;==>TrimLogFile1 point -
User Groups and Rights New Members - New members with that joined the forum within the last day. While in this group there are certain restrictions on the number of posts/PMs that can be made. This is to reduce the impact of spammers. After 24 hours members of this group will be promoted the Members group. Members - Members older than one day but with less than 20 posts. Standard access to the forum. Active Members - Members with more than 20 posts have additional rights No advertsSlightly more generous attachment and PM limitsAccess to the Chat forumAbility to upload files to the Downloads section MVPs - Members who are judged by the community to be helpful, who write and share useful code, who help the development of AutoIt. These users have the same rights as normal members but get a team icon, a little more attachment and PM space, and access to the MVP Chat forum section. Moderators - The forum police. This is not a democracy and each of the mods has their own distinct personality. They have the rights to edit posts, delete posts, ban users, delete users, IP ban, etc. Let the poster beware. Developers - A small group of users with access to the AutoIt source code and who have contributed significantly to the internal development of AutoIt. Some of them are also Moderators. Post Count and Rankings Ranks based on increasing post count are as follows: SeekerWayfarerAdventurerProdigyPolymathUniversalistThese titles are auto-generated and have no relation to actual skill level. Once you reach 300 posts you can change the title to whatever you like.1 point