-
Posts
561 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by sshrum
-
Interfacing with the Explorer shell...using AutoIT
sshrum replied to sshrum's topic in AutoIt General Help and Support
Point is to simplify things for non-scripters (this script will eventually be added to my player project and I'd like it to work like everyone is going to expect it to). :-p ultimately, I'm trying to make this as user-intuitive as possible using the shell as a common entrance...the Explorer shell allows for this interaction. Plus, I'm curious to figure out / work with what the shell is doing beyond 15 file selections. -
FileListToArray comprehensive comparison
sshrum replied to weaponx's topic in AutoIt Example Scripts
I made a small add to you code to handle non-recursive folder only returns: Func _RecursiveFileSearch($RFSstartDir, $RFSFilepattern = ".", $RFSFolderpattern = ".", $RFSFlag = 0, $RFSrecurse = True, $RFSdepth = 0) If StringRight($RFSstartDir, 1) <> "\" Then $RFSstartDir &= "\" If $RFSdepth = 0 Then $RFSfilecount = DirGetSize($RFSstartDir, 1) Global $RFSarray[$RFSfilecount[1] + $RFSfilecount[2] + 1] EndIf $RFSsearch = FileFindFirstFile($RFSstartDir & "*.*") If @error Then Return While 1 $RFSnext = FileFindNextFile($RFSsearch) If @error Then ExitLoop If StringInStr(FileGetAttrib($RFSstartDir & $RFSnext), "D") Then If $RFSrecurse And StringRegExp($RFSnext, $RFSFolderpattern, 0) Then _FileSearch($RFSstartDir & $RFSnext, $RFSFilepattern, $RFSFolderpattern, $RFSFlag, $RFSrecurse, $RFSdepth + 1) EndIf If $RFSFlag <> 1 Then $RFSarray[$RFSarray[0] + 1] = $RFSstartDir & $RFSnext $RFSarray[0] += 1 EndIf ElseIf StringRegExp($RFSnext, $RFSFilepattern, 0) And $RFSFlag <> 2 Then $RFSarray[$RFSarray[0] + 1] = $RFSstartDir & $RFSnext $RFSarray[0] += 1 EndIf WEnd FileClose($RFSsearch) If $RFSdepth = 0 Then ReDim $RFSarray[$RFSarray[0] + 1] Return $RFSarray EndIf EndFunc -
FileListToArray comprehensive comparison
sshrum replied to weaponx's topic in AutoIt Example Scripts
I too am on a quest for a more functional, faster FileSearch(). I like your recursivefilesearch function however, I hit a snag (sort of)...let's say you want to list all folders in a folder (no sub-subfolders; recurse=false). You have a flag for disabling Recurse so I figured this should work. $aDirs = _RecursiveFileSearch("o:\player\hotkeys", ".", ".", 2, False) I set recurse to false and I get nothing back (empty array). $aDirs = _RecursiveFileSearch("o:\player\hotkeys", ".", ".", 2, True, 1) I set recurse to true and depth to 1; the function bombs out. Is this a bug or am I passing the arguments wrong? does this go beyond what the function is designed to do? TIA -
Allows you to change the name of a file or folder to the current date/time. Accepts a token string for customization but will default if omitted. Running the app without params will display help dialog. I'm running this once a week on my source backup folder so I have a incremental backlog and creating a new backup folder for the current week. (I hate compressing stuff...300+ files and 1 bit goes bad in your archive....you're screwed) :-( Enjoy. Bin: http://www.shrum.net/code/datename/datename.exe Source: http://www.shrum.net/code/datename/datename.au3 Docs will be posted later...rly busy at the moment.
-
Thanks for the info... From those posts I was able to find that Randal is updating the FileListToArray(): http://www.autoitscript.com/forum/index.ph...mp;#entry372209 I'm going to use WeaponX's RecusiveFileSearch() for now as that is self contained and seems to do what I was wanting in a fast amount of time (i'm looking in over 1,000 folders for 40,000+ files. Thanks again.
-
I've seen a number of attempts to improve on this function and they typically use the DOS DIR command to achieve that goal. The problem with that is that DOS still does not deal with filenames with accented characters properly. While I too have created my own FileSearch function, it too uses DIR and has this same shortcoming. However, FileFindNextFile DOES properly return back accented chars. Does anyone have a snippet that shows how to do directory recursion using only FileFinds?
-
File Properties edit (ID3 tag?)
sshrum replied to Psibernetic's topic in AutoIt General Help and Support
I'm also looking for a way to edit ID3 tags too using AutoIT...maybe someone has a MP3 UDF or is making one (crossing fingers)? -
This is a bit off the autoit compass but since I solely use autoit and I'm just not that up on how Windows Explorer + Registry work, I figured someone here might have run into this and would have a quick answer. I've been writing a number of autoit-based file naming/copying/moving utilities for myself that I call via the explorer shell (the right click menu in Windows Explorer) So far this has been working great for anything from 1-15 files at a time...but then I noticed something If I select 1 more than 15 files, Windows no longer shows various pop-up menu items...including my \* shell commands...it's pulling from somewhere else. Now I know this isn't something that is wrong, I'm pretty sure that after 15 files Windows deals with large collections of files in a different way. My question is how do you code to accept what Windows Explorer is going to send if I select > 15 files and where in the registry do I write my shell and command keys to for when 15+ files are selected to launch my scripts. TIA
-
I'm using the _SQLite UDFs and I have a database created with a empty table defined. Here is my query code: $iResult = _SQLite_GetTable2d (-1, $sSQL, $aResult, $iRows, $iCols) When I run a query on an 1 record table I get back $iResult = 0 $iRows = 1 $iCols = 29 When I run the same query on a empty table I get $iResult = 0 $iRows = 0 $iCols = 0 I'm getting back a completely empty $aResult. I was expecting Rows = 0 and Cols = 29 (containing the field names). How do you extract field names from an empty table? Is this a bug or the expected reaction (I'm voting bug). EDIT: I played with the sqlite.au3 file....looks like SQLite is returning back 0 columns so it doesn't look like a issue specifically with the UDF. TIA
-
InetGet/InetGetSize only seeing half of file
sshrum replied to sshrum's topic in AutoIt General Help and Support
The link to the file is a direct one, not one delivered thru a php page so php has nothing to do with it. http://www.shrum.net/code/player/player.exe As for the site structure? Server + InetGet issues? Server is running Centos 5.2. I'm still baffled. EDIT: Whoooo....that's different. I just tried the link and got redirected to my files subdomain instead of it asking me to download the exe. I need to investigate that...I think this is turning out to be a server issue. -
InetGet/InetGetSize only seeing half of file
sshrum replied to sshrum's topic in AutoIt General Help and Support
Yes -
filedelete(@tempdir & "\player.exe") InetGet("http://www.shrum.net/code/player/player.exe", @tempdir & "\player.exe", 1,1) While @InetGetActive TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16) Sleep(250) Wend ShellExecute(@tempdir) If you go to the website and click in the binary link , any browser will report the download size as 438k. InetGetSize/InetGet keeps reporting 204 ergo the file is not all there (the file in the temp folder is only 204k and should be 438k) Any ideas?
-
Yet another media player (with a twist); 'Player'
sshrum replied to sshrum's topic in AutoIt Example Scripts
A brief technical write-up (that will be formallized later if enough people are interested) and the code for the main project and 250+ add-ons to-date can be found here: http://www.shrum.net/code/player It still needs some "clean" system testing but everything should be there. Starter archive with folders and files already laid out can be downloaded here: http://www.shrum.net/code/player/player.zip FYI: I noticed that when I had the database-catalog add-on recreate my 40,000 record database, that the commit took like 30+ minutes. First time I did this (a while ago) the commit took less than a minute. I set up catalog to build a giant SQL string and them commit that to the database. I did this cuz it was way faster then commiting records one at a time. Not sure if it's my system or not but after that little experiment everything was working as expected. Any ?'s just post here. -
I have a media player project I wrote that uses uncompiled .au3 files (basically I use shellexecute with the 'run' action) I know a lot of us have script collections and such we've written and leave in .au3 form (for quick and easy editting). My question: has anyone written a GUI that lists out these files in a easy to use interface for launching / editing them? Worst case I could always whip one up...but figured I'd ask first. TIA
-
Possible? Take a screenshot of a hidden AutoIT GUI
sshrum replied to sshrum's topic in AutoIt General Help and Support
I am trying to create a image that will span the 3 monitors I have. I've already written a app to do this but it places a gui window over the desktop...thus hidding the icons on the desktop underneath. If I can generate an image, I can set it as the BG...opps. Wait...scratch that...Vista won't let me do that. Nvrmnd -
I have a Windows based smartphone and would like to be able to access the storage on the phone just like Windows Explorer allows me to. Granted, Windows Explorer does not give the phone a drive letter but rather lists the storage on the phone under a Sub-catagory of Windows Mobile. Has anyone tinkered with this and know how to access the storage via AutoIT? Thanx
-
DynaDesk (web-enabled dynamic desktop wallpaper updater)
sshrum replied to sshrum's topic in AutoIt Example Scripts
The 'bloat' as you call it is my standard .au3 project template that I use on all my projects (just easier to make a quality project if you have something good to start from). Plus remember, this can pull from ANY web-based image. Moon phase: http://static.die.net/moon/320.jpg (centered w/ black bg) Sunlight map (mercator): http://static.die.net/earth/mercator/1600.jpg (stretch) Sunlight (peters): http://static.die.net/earth/peters/1600.jpg (stretch) Sunlight (mollweide): http://static.die.net/earth/mollweide/1600.jpg (stretch) Sunlight (equi-rectangular): http://static.die.net/earth/rectangular/1600.jpg (stretch) Sunlight (dusk/dawn): http://static.die.net/earth/hemisphere/1600.jpg (stretch) Granted I wrote this up quick originally in under ~50 lines The updates occur at whatever refresh interval you define (default is 60 minutes). Right click the systray icon and select Refresh under [settings] to change the interval. if you like this and have MULTIPLE monitors, take a look at my Vistas project (also written in AutoIT). -
I just wrote and posted this same app...with source available (why won't you show code?). http://www.autoitscript.com/forum/index.php?showtopic=80488
-
After watching the post about the guy who wrote a tool to pull the world sunlight map and have it update the desktop just to then bow out when asked for code got me thinking...I can write that. And I did and mine is a little better. Code here: http://www.shrum.net/code/dynadesk/dynadesk.au3 Binary here: http://www.shrum.net/code/dynadesk/dynadesk.exe First launch will prompt for a image URL (defaults to the world sunlight map) and refresh period (in minutes). It will download the file, save it to your temp folder and set the desktop wallpaper to it. Enjoy P.S. You might have to set your wallpaper properties to strech...I didn't code for that as I don't know the DLLCall to update that P.S.S. The systray menu options to homepage and news work but the content for them is currently being written up (you'll get back 0 search results in news and the template page I use for new projects for the homepage)
-
I've been mickey'ing around with a WMP object-based media player/manager script for some time (on and off for like a year) after I found a number of issues with the current options out there. Long story short: The player is written in AU3, uses SQLite for data storage, has no direct GUI to speak of (besides a systray icon+user customizable popup menu) and basically just reads/creates playlists and plays media files...but here's the kewl part: whenever a song is playing, player writes the metadata to the registry, making it available to any other script to query. "Why is that important?" you ask... As of right now, I have +120 addons that I've written in .AU3...some are basic (next, previous, toggle random, volume 50%), some more complex (playlist 5 stars, Current rate 3 stars), even others that you might notice from other palyers (Current artist Google.com) to variations on those features (Current artist YouTube.com, Current artist Thepiratebay.org). I've written a couple of playlist generator addons as well for doing specific field searches as well as fuzzy full text searches (on a database of around 40,000 records, my fuzzy searches take about 2 seconds). Addons can be compiled or left uncompiled in .au3 form (if you have AutoIT installed...the player 'run's the script when clicked...CTRL+clicks shellexecute with 'edit' action giving you the ability to mod the scripts at any time). Another benefit of this is that the addons (exe or au3) files are launched external of the player and therefore do not hamper script runtime. Example: while your sitting on addon query screen, the player doesn't stop because you have a dialog open. Technically, the player can run any file type that WMP supports (your plugins will vary) but for now excepts .mp3 and .wma files directly, as well as .m3u files. It even takes SQL statements in text files (.sql) for dynamic playlist creation ("Select SourceURL from MetaData where userEffectiverating>=75"). As I'm using the WMP object, the fieldnames match those documented for the WMP database. Ultimately the database can be trimmed to remove fields you don't want (this is not effect the player as I have programmed for this) I've currently got my player set up to store my statistics to my flash drive so when I play songs on my desktop or laptop, the statistics are centralized (which I love). Ultimately, I'd love to see this take off and have people start writting addons with GUIs and other features (one thing I have in mind to make is a SQL query builder that will read the database and display a WMP-like dynamic playlist generator). I'm currently in the process of cleaning up the catalog script (for initially building the database) but was concerned over whether or not to spend the extra time tailoring it for other users. If I get enuff interest in it, I'll sit down and fully document the thing. I'm also looking for code review as well... :-) So, waddayathink?
-
Is this a bug: random(1,1,1) returning 0
sshrum replied to sshrum's topic in AutoIt General Help and Support
I actually think I'll do as weaponx described...create a new func in my personal UDF called _Random and just do like his sample shows... I know this is beating a dead horse but honestly, I think (1,1,1) should return 1 -
Is this a bug: random(1,1,1) returning 0
sshrum replied to sshrum's topic in AutoIt General Help and Support
hehe weaponx...see the post above yours. I editted it just as you were posting But thanx for the input