Jump to content

I need major help


Recommended Posts

Well i got through the basic stuff and now i need help because my scripts don't work right.

For instance i need to open, say wordpad and type some stuff.

It opens wordpad and just stops. Im including the WinWaitActive element but somthings wrong

Edited by darksider
Link to comment
Share on other sites

  • Developers

Well i got through the basic stuff and now i need help because my scripts don't work right.

For instance i need to open, say wordpad and type some stuff.

It opens wordpad and just stops. Im including the WinWaitActive element but somthings wrong

Make sure the window gets the focus and the title text is correct or else WinWaitActive will wait forever.

It helps if you post the script portion you want us to help you with...

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Well i got through the basic stuff and now i need help because my scripts don't work right.

For instance i need to open, say wordpad and type some stuff.

It opens wordpad and just stops. Im including the WinWaitActive element but somthings wrong

I've noticed sometimes if a window already has focus winwaitactive may not work

Try winwait

then winactivate

Rick

Link to comment
Share on other sites

Yeah it was the fact that the window was in focus alerady that winwaitactive didn't work.

Anyway i've come along a bit and now i need an explanation on how filesavedialog works. the help file just confused me more

Link to comment
Share on other sites

Yeah it was the fact that the window was in focus alerady that winwaitactive didn't work.

Anyway i've come along a bit and now i need an explanation on how filesavedialog works. the help file just confused me more

I use that quite a bit

What confused you. Keep in my I'm no expert like these guys are

Rick

Link to comment
Share on other sites

in the example.....

My Docs=""::{450D8FBA-AD25-11D0-98A8-0800361B1103}

what does this mean

It is a CLSID, and it's a way to referance the "My Documents" folder on a user's computer. You'll notice that typing "My Documents" into an explorer window doesn't do the trick, so you have to use the CLSID instead. A practical use might be if you wanted to open a file select box that started in the users "My Documents" folder. My example works like this:

$file = FileOpenDialog("Pick a file","::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "All (*.*)")
If @error Then;no file chosen
  MsgBox(0, "None selected", "You didn't choose a file!")
Else;they did pick a file
  MsgBox(0, "File chosen", "You chose the file: " & $file)
EndIf

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

...

AND how would i find a CLSID of anygiven folder?

Look in the help file ("CLSIDs of special folders" in the appendix).

To save a file, look at the example of "FileSaveDialog" in the help file. You would typically replace the Else block with something such as FileWrite($filename, $contentsOfTheFile).

P.S. You could take a look at the code for AutoPad. It's a script I've abandoned working on--and it probably only compiles correctly with a specific unstable AutoIt-GUI build, but it might be helpful to you. Take a look at the routineSaveAs() function in the Events.au3 file.

Edited by CyberSlug
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

  • 3 weeks later...

i recenty encountered a malprocess. i need to make a program that uses a registry entry to start up when windows boots

that's an interesting statement. :ph34r: is there a question there?

regwrite will do it.

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

If you want to only have the program run the next time you reboot, write the line in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce.

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Link to comment
Share on other sites

yeah ok thanks guys that helped next topic XD sorry im a total newb

Is there anyway i could use a function like rand to input a series of random charecters includeing numbers and shift-charecters? Like put some sort of function in a while loop?

Link to comment
Share on other sites

Hey guys im new and im makin a script that i want to run every time windows starts and i really dont get what you mean by this...

you need to add to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

add a string in there with the exe of the file you want run.

So i just use regwrite to add this into registry and it'll make my program run every time at startup?

Link to comment
Share on other sites

Okay, trying to keep things as simple as possable, if you just want it to run when you log into windows, you just need to add a shortcut of the program to your Startup folder (which is probably something like c:\documents and settings\<USERNAME>\Start Menu\Programs\Startup .) That's it. Once you put the shortcut there, it will start every time you log in.

[Edit]: I know you can play with the registry keys as well. It's a pain to do that, and there's no advantage against it simple and adding it to the startup folder in this case.

However, if you really mean that you want it to start when windows starts, you need to add it as a system service. The eaisiest way to start any program before you log in is to use the windows task scheduler. Under XP or 2000, you can find this in the "Scheduled Tasks" control panel. Just add a scheduled task, and tell it to start on boot. Please note unless you know what you're doing, your probably don't need to define a task to start on boot. Chances are really good you mean to start it when you log in.

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Yeah glad you cleared that up

*BUMP*

Hey i had this idea to assign every charecter on the keyboad its own ID number and then jumble those numbers around in an array and then convert them into input

It would be a rather painstaking process but unless anyone has any other ideas that may be what i have to work with

Link to comment
Share on other sites

You just want a random character from a set? Define the set as an array using StringSplit, like this: $array = StringSplit("abcdefghijk...", "") and then pick a random number from 1 to the end of the array like this: $random = $array[int(Random(1, UBound($array)))]

It's that simple.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...