| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Mon Jun 18, 2007 10:55 pm Post subject: Upload? |
|
|
| Is there a simple way to upload something, like a webpage ?(upload it to autohotkey.net). |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Mon Jun 18, 2007 11:01 pm Post subject: |
|
|
See example given in FileAppend command.  |
|
| Back to top |
|
 |
Travley
Joined: 13 May 2007 Posts: 47
|
Posted: Mon Jun 18, 2007 11:26 pm Post subject: |
|
|
Decided to make this for myself after seeing your own request. Hope this helps, Tis tested and works fine on my end with FireFox.
| Code: | #SingleInstance Force
#NoEnv
SendMode Input
siteurl = http://www.autohotkey.net
delay = 5000
username = youruser
password = yourpass
browser = C:\program files\Mozilla Firefox\firefox.exe
FileSelectFile, File2Upload, 1, RootDir\Filename, Select Which File You Wish to Upload, AHK Documents (*.ahk)
Run %browser% %siteurl%
WinWait, ahk_class MozillaUIWindowClass
Sleep, %delay%
IfWinNotActive, ahk_class MozillaUIWindowClass
{
WinActivate, ahk_class MozillaUIWindowClass
goto Login
}
IfWinActive, ahk_class MozillaUIWindowClass
{
goto Login
}
Login:
Send {tab 20}
Send %username%
Send {tab}
Send %password%
Send {enter}
Sleep, %delay%
goto Upload
Upload:
Send {tab 7}
Send {enter}
Sleep, %delay%
goto FileInsert
FileInsert:
Send {tab}
Send %File2Upload%
Send {tab 4}
Send {space}
Sleep, %delay%
Goto Clippy
Clippy:
SplitPath, File2Upload, name
clipboard = %siteurl%/~%username%/%name%
MsgBox, , Success!, The File Was Successfully Uploaded. The URL of your file is now in clipboard.
Return |
Last edited by Travley on Mon Jun 18, 2007 11:51 pm; edited 3 times in total |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Mon Jun 18, 2007 11:28 pm Post subject: |
|
|
a nice add on to this would be to put the uploaded file's URL in the clipboard or something. _________________
(Common Answers) |
|
| Back to top |
|
 |
Travley
Joined: 13 May 2007 Posts: 47
|
Posted: Mon Jun 18, 2007 11:29 pm Post subject: |
|
|
Very true eng, I will look in to this, but it may be over my head.
Cheers.
Edit : Yep Above my head, it has to do with me not understanding how to parse HTML to find the 'Open URL' url. This could be cross-referenced (url wise) to the filename itself to determine which it truely is. But this is way above me.
I'd love to see this done.
Cheers.
Last edited by Travley on Mon Jun 18, 2007 11:31 pm; edited 1 time in total |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Mon Jun 18, 2007 11:30 pm Post subject: |
|
|
it should be:
| Code: |
http://www.autohotkey.net/~%username%/%File2Upload%
|
or similar. _________________
(Common Answers) |
|
| Back to top |
|
 |
Travley
Joined: 13 May 2007 Posts: 47
|
Posted: Mon Jun 18, 2007 11:31 pm Post subject: |
|
|
Ahhh very true! However since the %file2upload% is being called with both RootDir\Filename I'm not sure how to filter out specifically the file selected, and not the entire location.
Any ideas? |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Mon Jun 18, 2007 11:34 pm Post subject: |
|
|
SplitPath _________________
(Common Answers) |
|
| Back to top |
|
 |
Travley
Joined: 13 May 2007 Posts: 47
|
Posted: Mon Jun 18, 2007 11:37 pm Post subject: |
|
|
| engunneer wrote: | | SplitPath |
Cheers! Gimmie a few minutes and I'll have a new one up'd. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Mon Jun 18, 2007 11:38 pm Post subject: |
|
|
you can just edit your post above with the new code, so there is less confusion. you could even post it in Scripts and functions, since that's pretty useful, and others will probably give tips on how to improve it. _________________
(Common Answers) |
|
| Back to top |
|
 |
Travley
Joined: 13 May 2007 Posts: 47
|
Posted: Mon Jun 18, 2007 11:46 pm Post subject: |
|
|
| Nevermind .. Got it.. Updated my original post with finished code. Thank You VERY MUCH Eng. |
|
| Back to top |
|
 |
|