Sign in to follow this  
Followers 0
Gaviel

Passing an argument

9 posts in this topic

Hi ,.. I'm new to autoit .. I just wanna ask a question ..

How can you open IE and pass an argument as a URL ?!

thanks

Share this post


Link to post
Share on other sites



I think the example for _IENavigate should give you an idea.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I think the example for _IENavigate should give you an idea.

I already saw and have read it already .. Maybe I'm not clear with my question ..

For example .. I want to open a facebook profile

http://www.facebook.com/#!/profile.php?id=[argument]

we're argument is the profile ID that I will pass ..

How to do it with autoit?!

thanks ..

PS: I already see the $cmdline in the help section .. But I can't understand how to apply it in a URL ..

Edited by Gaviel

Share this post


Link to post
Share on other sites

$sID = "blahblah"
_IECreate("http://www.facebook.com/#!/profile.php?id=" & $sID)

I think you only assigned a variable there .. So If I compiled .. That would just simply open or can open only 1 URL ..

How can I make this clear ..

hmm ... Is it possible to pass command line options to an application written or compiled in Autoit when you start the application ..?

I hope I'm clear with my question ..

thanks for the replies ..

Share this post


Link to post
Share on other sites

Gaviel,

I hope I'm clear with my question

Your question is clear now! :)

Look in the Help file under <Using AutoIt - Command Line Parameters> and hopefully the answer will become equally clear. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Gaviel,

Your question is clear now! ;)

Look in the Help file under <Using AutoIt - Command Line Parameters> and hopefully the answer will become equally clear. :)

M23

;) On my post above .. I already mentioned that I already read that .. But unfortunately I can't get it working right ..

here's the code that I tried

#include <IE.au3>
$oIE = _IECreate ("http://www.$cmdLine[1].com")

But after I compiled it and run it in Command Prompt .. I get an error saying "Error in expression"

Share this post


Link to post
Share on other sites

:) Gaviel,

You need to learn a bit more about AutoIt before you go much further! :shocked:

Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. ;)

In this case you need to use the concatenation operator & to combine the strings like this:

$oIE = _IECreate ("http://www." & $cmdLine[1] & ".com")

I would really recommend the tutorials - you will find coding much less frustrating when you have a better grasp of the syntax and structure of an Autoit script! ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

;) Gaviel,

You need to learn a bit more about AutoIt before you go much further! :)

Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. :)

In this case you need to use the concatenation operator & to combine the strings like this:

$oIE = _IECreate ("http://www." & $cmdLine[1] & ".com")

I would really recommend the tutorials - you will find coding much less frustrating when you have a better grasp of the syntax and structure of an Autoit script! :shocked:

M23

So that's what I'm missing .. Thank you so much ..

Yeah .. I think I'll go with the reading .. Will probably look at the wiki ..

thanks again for all the replies . ;)

Share this post


Link to post
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
Sign in to follow this  
Followers 0