spitzer89 Posted July 5, 2011 Share Posted July 5, 2011 Well i have now been seaching the internet for some hours and i cant figure out how to script what i need :/ so i came to the idea that maybe you guys could figure it out for me i will go though it step by step 1 i need to go to my image folder 2 in that folder i want to select/highlight 50 random files job done i need to select 50 random images in this folder 3 times everyday so it would be pretty helpful if anyone knows how to do that Link to comment Share on other sites More sharing options...
Tvern Posted July 5, 2011 Share Posted July 5, 2011 Would it be acceptable to copy/move the 50 files to another folder instead? That'd be easier and more reliable. You can then select all files in that folder. Link to comment Share on other sites More sharing options...
spitzer89 Posted July 5, 2011 Author Share Posted July 5, 2011 in that case i would prefer them to be copied to another fold so the images would be in the other fold and the originally one Link to comment Share on other sites More sharing options...
JohnOne Posted July 5, 2011 Share Posted July 5, 2011 _FileListToArray() Random() Are 2 function you could accomplish your task. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
spitzer89 Posted July 5, 2011 Author Share Posted July 5, 2011 great, but i still dont know how i cant script at all and im not going to learn since im already studying drawing, 3d and 2d graphis and going to school in 3 weeks so sorry no time to learn anymore :/ Link to comment Share on other sites More sharing options...
JohnOne Posted July 5, 2011 Share Posted July 5, 2011 Then what are you even doing here in a help forum? try rentacoder.com AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Tvern Posted July 5, 2011 Share Posted July 5, 2011 (edited) Edit: yeah I just read that last post. never mind then. Study the helpfile for a day and you will be well on your way to writing basic scripts. I can assure you you're going to find it a lot more educational than the first month of school. Edited July 5, 2011 by Tvern Link to comment Share on other sites More sharing options...
jaberwacky Posted July 6, 2011 Share Posted July 6, 2011 How much is it worth to you? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
spitzer89 Posted July 6, 2011 Author Share Posted July 6, 2011 How much is it worth to you?not so much that i will pay for it JohnOnewell i read another post where someone asked for help to some code and someone just wrote the code he needed in a reply so i figured it was worth a try Link to comment Share on other sites More sharing options...
JohnOne Posted July 6, 2011 Share Posted July 6, 2011 Fair enough. But if you look at and run the examples of the functions mentioned you will have a script in no time at all. $array = _Filelisttoarray("path") will give you an array as mentioned. Ramdom(1,$array[0],1) will give you a random number withing the bounds of your array. A little if else logic will see you from there. Write that, and you will get all the help you need here. Good luck. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
spitzer89 Posted July 6, 2011 Author Share Posted July 6, 2011 (edited) thx alot i will give it a shot edit : ok i been reading the help file a little and messing around with lines of code you suggested and well im getting nowhere :s i understand nothing of what im doing actully in this program :/ Edited July 6, 2011 by spitzer89 Link to comment Share on other sites More sharing options...
spitzer89 Posted July 6, 2011 Author Share Posted July 6, 2011 so this is kinda getting on my nerves so i will pay the person who can make me a script that fixs my problem 5 dollars the money will be sent to you with paypal Link to comment Share on other sites More sharing options...
JohnOne Posted July 6, 2011 Share Posted July 6, 2011 (edited) You can send the five snots to the forum as a donation. http://www.autoitscript.com/site/donate/ #include <File.au3> Local $i_NumPics = 50 Local $a_RandomNumber[$i_NumPics] $s_ImageArray = _FileListToArray("C:\my\folder\path", "*", 1) ; array of all files in your image folder $b_Unique = True For $i = 0 To UBound($a_RandomNumber) - 1 Do $b_Unique = True ; presume number is unique $irnd = Random(1, Int($s_ImageArray[0]), 1) ; select a random number withing imagearray bounds For $j = 0 To UBound($a_RandomNumber) - 1 ;loop throug If $irnd = $a_RandomNumber[$j] Then ; you already have that number $b_Unique = False ; booooooooooooooo ExitLoop EndIf Next If $b_Unique Then ; we dont have that number $a_RandomNumber[$i] = $irnd ; yaaaaaaaaaay EndIf Until $b_Unique ; keep going until random number is unique Next For $i = 0 To UBound($a_RandomNumber) -1 ConsoleWrite($s_ImageArray[$a_RandomNumber[$i]] & @CRLF) ; list your image files Next Edited July 6, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
spitzer89 Posted July 6, 2011 Author Share Posted July 6, 2011 so atm it looks like this #include <File.au3> Local $i_NumPics = 50 Local $a_RandomNumber[$i_NumPics] $s_ImageArray = _FileListToArray("C:\Users\Steffen\Desktop\imagestest", "*", 1) ; array of all files in your image folder $b_Unique = True For $i = 0 To UBound($a_RandomNumber) - 1 Do $b_Unique = True ; presume number is unique $irnd = Random(1, Int($s_ImageArray[0]), 1) ; select a random number withing imagearray bounds For $j = 0 To UBound($a_RandomNumber) - 1 ;loop throug If $irnd = $a_RandomNumber[$j] Then ; you already have that number $b_Unique = False ; booooooooooooooo ExitLoop EndIf Next If $b_Unique Then ; we dont have that number $a_RandomNumber[$i] = $irnd ; yaaaaaaaaaay EndIf Until $b_Unique ; keep going until random number is unique Next For $i = 0 To UBound($a_RandomNumber) -1 ConsoleWrite($s_ImageArray[$a_RandomNumber[$i]] & @CRLF) ; list your image files Next but nothing happens when i run it :s ? Link to comment Share on other sites More sharing options...
JohnOne Posted July 6, 2011 Share Posted July 6, 2011 run it from scite4autoit, and the output is in the console window AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
spitzer89 Posted July 6, 2011 Author Share Posted July 6, 2011 well cant figur it out :s anyways i have fixed the problem myself i found a program called mix2stick that kinda does what i need but thx for trying Link to comment Share on other sites More sharing options...
jaberwacky Posted July 6, 2011 Share Posted July 6, 2011 Yeah, there are a couple of members who have fully coded, debugged, feature filled custom solutions ready for newbs who ask for help in like five minutes flat. I can't explain it how they do it. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
JoHanatCent Posted July 6, 2011 Share Posted July 6, 2011 (edited) well cant figur it out :s anyways i have fixed the problem myself i found a program called mix2stick that kinda does what i need but thx for tryingSo don't give up so eazily! You only missed one slash: #include <File.au3> Local $i_NumPics = 50 Local $a_RandomNumber[$i_NumPics] $s_ImageArray = _FileListToArray("C:\Gifs\Users\Steffen\Desktop\imagestest\", "*", 1) ;<<<< === study this line carefully $b_Unique = True For $i = 0 To UBound($a_RandomNumber) - 1 Do $b_Unique = True ; presume number is unique $irnd = Random(1, Int($s_ImageArray[0]), 1) ; select a random number withing imagearray bounds For $j = 0 To UBound($a_RandomNumber) - 1 ;loop throug If $irnd = $a_RandomNumber[$j] Then ; you already have that number $b_Unique = False ; booooooooooooooo ExitLoop EndIf Next If $b_Unique Then ; we dont have that number $a_RandomNumber[$i] = $irnd ; yaaaaaaaaaay EndIf Until $b_Unique ; keep going until random number is unique Next For $i = 0 To UBound($a_RandomNumber) - 1 ConsoleWrite($s_ImageArray[$a_RandomNumber[$i]] & @CRLF) ; list your image files Next Adding note == > Edited July 6, 2011 by JoHanatCent Link to comment Share on other sites More sharing options...
spitzer89 Posted July 6, 2011 Author Share Posted July 6, 2011 So don't give up so eazily! You only missed one slash: #include <File.au3> Local $i_NumPics = 50 Local $a_RandomNumber[$i_NumPics] $s_ImageArray = _FileListToArray("e:\Gifs\Users\Steffen\Desktop\imagestest\", "*", 1) ;<<<< === study this line carefully $b_Unique = True For $i = 0 To UBound($a_RandomNumber) - 1 Do $b_Unique = True ; presume number is unique $irnd = Random(1, Int($s_ImageArray[0]), 1) ; select a random number withing imagearray bounds For $j = 0 To UBound($a_RandomNumber) - 1 ;loop throug If $irnd = $a_RandomNumber[$j] Then ; you already have that number $b_Unique = False ; booooooooooooooo ExitLoop EndIf Next If $b_Unique Then ; we dont have that number $a_RandomNumber[$i] = $irnd ; yaaaaaaaaaay EndIf Until $b_Unique ; keep going until random number is unique Next For $i = 0 To UBound($a_RandomNumber) - 1 ConsoleWrite($s_ImageArray[$a_RandomNumber[$i]] & @CRLF) ; list your image files Next Adding note == > thx i will look into this later, but for now i have a drawing class to attend to but i kinda like this forum people are pretty helpful hehe i know i give up pretty easy but code really isnt my strong side im more a well visual kinda guy Link to comment Share on other sites More sharing options...
JohnOne Posted July 6, 2011 Share Posted July 6, 2011 Well you should bear in mind that a programing language will most likely come into play at some point during your Drawing education, and it wont harm you to get a head start. You could think of Autoit as a hobby if you want, but I guarantee it will help you in the future. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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