Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/29/2013 in all areas

  1. Hi there! I just wrote a ZIP udf in AutoIt (without external files) which lets you create archives, fill them with files and folders and extract them to your computer these are the functions <<go to the last release's section and jump previous releases's posts>> ======================= Updated ======================= UPDATED 30/6/2008 UPDATED 24/9/2008 Fixed Various Bugs Added Wait Function to let the script sleep until the files havn't been zipped Changed Function Names new format is: _Zip_TheFunction() UPDATED 13/10/2008 _Zip_AddFolder() now changed in _Zip_AddFolderContents() New Function : _Zip_AddFolder() that now adds the whole folder creating a subdirectory in the zip file _Zip_Count() Bug Finally fixed UPDATED 6/11/2008 New Function : _Zip_CountAll() that counts all elements in the archive. Including SubDirectories UPDATED 28/11/2008 New Virtual Zipping Functions this is actually very cool stuff! Maybe useless, but cool. UPDATED 17/03/2009 Added _Zip_Delete($hZipFile, $hFilename, $flag = 1). Very slow but it works... It'll be improved FLAGS WORK! Here are the User CallTip Entries: _Zip_Create($FileName) Create Zip File. Required #include <Zip.au3> _Zip_AddFile($ZipFile, $File2Add, [$flag]) Add file to Zip Archive. Required #include <Zip.au3> _Zip_AddFolder($ZipFile, $Folder, [$flag]) Add folder to Zip Archive. Required #include <Zip.au3> _Zip_AddFolderContents($ZipFile, $Folder, [$flag]) Add folder's content to Zip Archive. Required #include <Zip.au3> _Zip_Delete($ZipFile, $hFileName, [$flag]) _Zip_UnzipAll($ZipFile, $DestPath, [$flag]) Extract all files from Zip Archive. Required #include <Zip.au3> _Zip_Unzip($ZipFile,$FileName, $DestPath, [$flag]) Extract file from Zip Archive. Required #include <Zip.au3> _Zip_Count($ZipFile) Count items in zip. Required #include <Zip.au3> _Zip_CountAll($ZipFile) Count All items in the Zip Archive Including SubDirectories. Required #include <Zip.au3> _Zip_List($ZipFile) List items in zip. Required #include <Zip.au3> _Zip_Search($ZipFile, $SearchString) Search a File in the Zip Archive. Required #include <Zip.au3> _Zip_SearchInFile($ZipFile, $SearchString) Search In each File of the Zip Archive. Required #include <Zip.au3> _Zip_VirtualZipCreate($ZipFile, $Path) Create a Virtual Zip. Required #include <Zip.au3> _Zip_VirtualZipDelete($VirtualZipHandle) Delete a Virtual Zip. Required #include <Zip.au3> Example Script ; Zip Example ; _________________________________ ; ; Zip UDF Example by torels_ ; _________________________________ #include "Zip.au3" Dim $Zip, $myfile $myfile = @DesktopDir & "\foo.au3" $Zip = _Zip_Create(@DesktopDir & "\zip_002.zip") ;Create The Zip File. Returns a Handle to the zip File _Zip_AddFile($Zip,$myfile) ;add $myfile to the zip archive _Zip_AddFolder($Zip,@desktopdir & "\Folder_001",4) ;Add a folder to the zip file (files/subfolders will be added) _Zip_AddFolderContents($Zip, @DesktopDir & "\MyFolder") ;Add a folder's content in the zip file MsgBox(0,"Items in Zip","there are " & _Zip_Count($Zip) & " items in " & $Zip) ;Msgbox Counting Items in $Zip MsgBox(0,"Items in Zip","there are " & _Zip_CountAll($Zip) & " Elements in " & $Zip) ;Msgbox Counting Elements in $Zip $search = _Zip_Search($Zip,"foo.au3") ;Returns an array containing the search results For $i = 0 to UBound($search) - 1 ; Print Each ConsoleWrite($search[$i]) & @LF ; Corresponding value Next ; In The Console $list = _Zip_List($Zip) ;Returns an array containing all the files in the zip file ConsoleWrite("============== ZIP Contents ============" & @LF) For $i = 0 to UBound($list) - 1 ConsoleWrite($list[$i] & @LF) ;Print Search Results in the console Next Exit Comments are welcome previous number of downloads: 1787 & a few more XD Zip.au3
    1 point
  2. trancexx

    ZIP browser

    Likely not very needed script in the packed form. Nevertheless very needed when it comes to binary data examination. Challenging in all cases. Made upon this document. The main and the most complex task was how to draw the content of the zip in a gui. I've chosen a treeview control for reasons known only to me. Script: ZIP_Browser.zip Try it if you dare. edit: I've added ability to preview or extract compressed files from within the ZIP archive. The method used here doesn't use any third party dlls nor Shell.Application object. It's rather unique approach relying on standard system's ziplfldr.dll and its internal API. I haven't seen anyone ever doing what I did here . Hopefully it works LOL. If not - do report back to me.
    1 point
  3. Like this, which assumes that the desired tab is already active: $oIE = _IEGetActiveTab() If @error = $_IEStatus_Success Then $oFrame = _IEFrameGetObjByName ($oIE, "main") Endif
    1 point
  4. So, you have multiple tabs that match the "Fleece" title, correct? You may want to check out >this post, which should work as long as the titles have some variation between the tabs.
    1 point
  5. Welcome to the Forum rolz639. We like to help those who help themselves, so show us what code you've got so far, and we'll advise improvements/fixes. It's also important for us to know, that you understand to some degree the help we will be giving. This means, that using the Help file and doing some Tutorials and Exercises, to start with will make it clear to us that you are making an effort to learn, which will be evident in any code you provide. So we are not in the habit of providing code at request, like some code-it-for-you website. That said, there are plenty of examples of RAR use in the Examples section of the forum, with some not too hard to understand if you have some basic AutoIt knowledge. Cheers!
    1 point
  6. Actually, what you describe would be more akin to random(n) - and I think most people wouldn't be too confused about that failing (except AutoIt's Random assumes it to be the Max value and etc.) I think the discussion ends up being of of philosophy - e.g. whether you view it as random number generation, or random number selection. In the case of generation, you're basically taking the two inputs, n and m, converting them to numbers, 10 and 10, and then saying "now pick a random number between 10 and 10". Since 10 is 10 is 10, there's no random selection to be made, and saying the generation failed can be seen as appropriate. Edit: Thinking of it a bit more, an alternate view would be a physical number line. If you were to draw a line for the range (3,5) and ask a person to cross that line somewhere at random, that should be very easy to do, and the number closest to where it crosses would be the result for random(3,5) (assuming the underlying float to int would be a rounding function). If you were to draw a 'line' for the range (10,10), you end up with a point. While of course the dot of a pencil (a circle and thus along the number line a very short line) is something you could cross, hitting the point exactly is effectively impossible. But if you think of it as random number selection, things change. Let's take random(n=1,m=5) and assume it only selects integers. You're basically asking it to pick from this sequence of numbers: n=1, 2, 3, 4, m=5. The result is either n, m, or any of the integers in between. Now take random(1,2). You're asking it to pick from this sequence of numbers: n=1, m=2. The result is either n or m. There's no integers in between. Now take random(10,10). You're asking it to pick from this sequence of numbers: n=10, m=10. The result is still either n or m. Now, the result to you may always be '10' which makes you think it's not random. But in terms of the random function, the '10' being returned may be n, or it may be m. Essentially, the two 10s are not in fact the same thing, they just have the same value. Or, alternatively by analogy, let's say you've got a coin with two heads. Those of the former philosophy will simply claim that the coin cannot be flipped and anybody trying to do so should realize the pointlessness of trying. Those of the latter accept that it's pointless to flip it, will happily flip it anyway, and accept that the result is heads. ( Somebody else in one of the other threads made the analogy of a deck of cards with all cards being, say, Ace of Spades, being handled by a magician and the magician showing them to you with the backs towards you, asking you to pick one at random. Essentially, the fact that it's always going to be an Ace of Spades is unknown to you - but you still made the selection at random. ) Ultimately, I don't really care.. now that I know AutoIt's Random() has this 'gotcha', I know how to avoid it (by using _Random()) - but it's a trap easily fallen into, especially when coming from other languages.. documentation (at least it's in the beta) or not. Edited September 28, 2013 by kamiquasi New edit: Hey look at that, they changed the behavior in 3.3.14.0 (2015/Jul/10) http://www.autoitscript.com/trac/autoit/ticket/2686 Thanks devs for listening!
    1 point
  7. use: $sStringToInsert = "line1\rline2\r" Jos
    1 point
×
×
  • Create New...