AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Upload?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Mon Jun 18, 2007 10:55 pm    Post subject: Upload? Reply with quote

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

PostPosted: Mon Jun 18, 2007 11:01 pm    Post subject: Reply with quote

See example given in FileAppend command. Smile
Back to top
View user's profile Send private message Send e-mail
Travley



Joined: 13 May 2007
Posts: 47

PostPosted: Mon Jun 18, 2007 11:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Mon Jun 18, 2007 11:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Travley



Joined: 13 May 2007
Posts: 47

PostPosted: Mon Jun 18, 2007 11:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Mon Jun 18, 2007 11:30 pm    Post subject: Reply with quote

it should be:
Code:

http://www.autohotkey.net/~%username%/%File2Upload%


or similar.
_________________

(Common Answers)
Back to top
View user's profile Send private message Visit poster's website
Travley



Joined: 13 May 2007
Posts: 47

PostPosted: Mon Jun 18, 2007 11:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Mon Jun 18, 2007 11:34 pm    Post subject: Reply with quote

SplitPath
_________________

(Common Answers)
Back to top
View user's profile Send private message Visit poster's website
Travley



Joined: 13 May 2007
Posts: 47

PostPosted: Mon Jun 18, 2007 11:37 pm    Post subject: Reply with quote

engunneer wrote:
SplitPath


Cheers! Gimmie a few minutes and I'll have a new one up'd.
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Mon Jun 18, 2007 11:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Travley



Joined: 13 May 2007
Posts: 47

PostPosted: Mon Jun 18, 2007 11:46 pm    Post subject: Reply with quote

Nevermind .. Got it.. Updated my original post with finished code. Thank You VERY MUCH Eng.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group