ezzetabi Posted April 18, 2005 Share Posted April 18, 2005 Works better with extension less files (or files that have the extension hidden like .lnk). Local $text = FileOpenDialog('Select the file(s)', @HomeDrive, 'All (*)', 5) If @error Then Exit If StringInStr($text, '|') Then Local $files $files = StringSplit($text, '|') If StringRight($files[1], 1) <> '\' Then $files[1] = $files[1] & '\' Else Local $files[3] $files[0] = 2 $files[1] = StringLeft($text, StringInStr($text, '\', 0, -1)) $files[2] = StringTrimLeft($text, StringInStr($text, '\', 0, -1)) EndIf Local $filen, $c, $ext $filen = " " ;<--- if it does not work replace the 'space' with a ALT+255 For $c = 2 to $files[0] While FileExists($files[1] & $filen & '.*') $filen = $filen & " " ;<--- if it does not work replace the 'space' with a ALT+255 Wend $ext = StringTrimleft($files[$c], StringInStr($files[$c], '.', 0, -1)-1) FileMove($files[1] & $files[$c], $files[1] & $filen & $ext) Next Link to comment Share on other sites More sharing options...
zcoacoaz Posted April 19, 2005 Share Posted April 19, 2005 Thats pretty cool [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font] Link to comment Share on other sites More sharing options...
ezzetabi Posted April 19, 2005 Author Share Posted April 19, 2005 Improved, no need to add a ALT+255 if extension is different... Local $text = FileOpenDialog('Select the file(s)', @HomeDrive, 'All (*)', 5) If @error Then Exit If StringInStr($text, '|') Then Local $files $files = StringSplit($text, '|') If StringRight($files[1], 1) <> '\' Then $files[1] = $files[1] & '\' Else Local $files[3] $files[0] = 2 $files[1] = StringLeft($text, StringInStr($text, '\', 0, -1)) $files[2] = StringTrimLeft($text, StringInStr($text, '\', 0, -1)) EndIf Local $filen, $c, $ext $filen = " " For $c = 2 to $files[0] $ext = StringTrimleft($files[$c], StringInStr($files[$c], '.', 0, -1)-1) While FileExists($files[1] & $filen & $ext) $filen = $filen & " " Wend FileMove($files[1] & $files[$c], $files[1] & $filen & $ext) Next Link to comment Share on other sites More sharing options...
steveR Posted April 19, 2005 Share Posted April 19, 2005 Hehe, That's almost scary looking AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted April 19, 2005 Share Posted April 19, 2005 I ran it on a text file, and the filename just became a space (I checked, ASCII code 40)...Is that what is supposed to happen? Alt+1060 works even better if you want to hide a file from someone, as it is a non-breaking-space, something not available on a keyboard. Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
ezzetabi Posted April 20, 2005 Author Share Posted April 20, 2005 (edited) ASCII 40(decimal) is a '(' ASCII 40(hex) is a '@' About ALT-1060 it is not a space. What are saying? Anyway it is a 'emtpy filename renamer', it just change the name with a empty name using the 255th char of OEM ASCII table. Edited April 20, 2005 by ezzetabi Link to comment Share on other sites More sharing options...
Green_Lantern Posted April 20, 2005 Share Posted April 20, 2005 MSLx Fanboy meant ALT+0160. I don't mean to talk bad about your script, but it's pointless. Automation is supposed to make complex tasks simple. This script does the opposite. DreamHost: great web hosting for as little as $7.95 a month. Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted April 20, 2005 Share Posted April 20, 2005 Hehe, see, that's why I have to keep asking you GL. I'm a tiny bit dyslexic with ASCII codes... Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
zcoacoaz Posted April 20, 2005 Share Posted April 20, 2005 Local $text = FileOpenDialog('Select the file(s)', @HomeDrive, 'All (*)', 5) If @error Then Exit If StringInStr($text, '|') Then Local $files $files = StringSplit($text, '|') If StringRight($files[1], 1) <> '\' Then $files[1] = $files[1] & '\' Else Local $files[3] $files[0] = 2 $files[1] = StringLeft($text, StringInStr($text, '\', 0, -1)) $files[2] = StringTrimLeft($text, StringInStr($text, '\', 0, -1)) EndIf Local $filen, $c, $ext $filen = Chr ( 0 ) For $c = 2 to $files[0] $ext = StringTrimleft($files[$c], StringInStr($files[$c], '.', 0, -1)-1) While FileExists($files[1] & $filen & $ext) $filen = $filen & " " Wend FileMove($files[1] & $files[$c], $files[1] & $filen & $ext) Next thats better, on a shortcut there is no box below the icon when you select it. [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font] Link to comment Share on other sites More sharing options...
layer Posted April 20, 2005 Share Posted April 20, 2005 MSLx Fanboy meant ALT+0160.I don't mean to talk bad about your script, but it's pointless. Automation is supposed to make complex tasks simple. This script does the opposite.<{POST_SNAPBACK}>of course autoit is for automation.. but its fine to have fun with it, and make coolio scripts like ezzetabi just did FootbaG Link to comment Share on other sites More sharing options...
buzz44 Posted April 21, 2005 Share Posted April 21, 2005 And seeing as you can't do this manually, I don't think anyway, I think its a good script as to broaden the horizon of our physical boundaries. qq Link to comment Share on other sites More sharing options...
CyberSlug Posted April 23, 2005 Share Posted April 23, 2005 Reminds me of information here:http://www.virtualplastic.net/html/icn_desk.html#4 Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Green_Lantern Posted April 26, 2005 Share Posted April 26, 2005 And seeing as you can't do this manually, I don't think anyway, I think its a good script as to broaden the horizon of our physical boundaries.The reason I made the statement above is because you CAN do this manually. It is accually simpler than using his script.1. Create a folder2. Rename folder by holding down ALT and pressing 0160 on your keypadThat's it.Also, as was said earlier, you can create a link with no name - just the .lnk extention. DreamHost: great web hosting for as little as $7.95 a month. Link to comment Share on other sites More sharing options...
ezzetabi Posted April 26, 2005 Author Share Posted April 26, 2005 @Green Lantern Yep, but for a file you have actually to: 1. select the file 2. press F2 3. press Left arrow 4 or more times 4. press shift + home 5. press ALT+255 (or ALT+0160) I never said this script was a ultimate geniality. It is just a little joke. If you do not like it, avoid this topic. @Xenogis It does not work to me! Are you sure you can add Chr(0) to autoit's strings? @MSLx Fanboy I was wrong, sorry. You probably meant 40 in octal that is actually a space. But please explicit what base you use. Ok? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now