Page 1 of 1

1 Question <----NOOB

Posted: Thu Apr 17, 2014 7:24 pm
by Alex_CTZ
Hey guys,
I am trying to get it so when the user clicks button it downloads a certain file into a path such as "C:\Program Files\Server"

Ive tried using the "get" method but I don't know how to chose where to save the file. PLEASE HELP!

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 7:56 pm
by atout66
May be you could find the answer in this lesson:
http://lessons.runrev.com/s/lessons/m/4 ... put-output

Sorry, I can't help you farther, I'm a beginner too :wink:

Kind regards, Jean-Paul.

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 8:05 pm
by Alex_CTZ
atout66 wrote:May be you could find the answer in this lesson:
http://lessons.runrev.com/s/lessons/m/4 ... put-output

Sorry, I can't help you farther, I'm a beginner too :wink:

Kind regards, Jean-Paul.
Cheers Ill check it out ;)

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 8:06 pm
by Alex_CTZ
Sorry not what I was looking for, can any 1 help?

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 8:18 pm
by dunbarx
Hi.

If you are successful with the "get URL..." portion, is it just that you don't know how to save it to a file?

Look at the "open" and "write to file" commands.

Craig Newman

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 8:28 pm
by jmburnod
Hi Alex,

Try this

Code: Select all

on mouseUp
   put url "http://www.alternatic.ch/jmb/DevLiveCode/OneText.txt" into tText
   ask file "Save to" with "Untitled.txt"
   if it <> empty then put tText into url("File:" & it)
end mouseUp
Best regards
Jean-Marc

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 8:51 pm
by Alex_CTZ

Code: Select all

on mouseUp
   create folder "C:\Program Files\GNTool"
   get url "DOWNLOADLINK"
   open file "C:\Program Files\GNTool" for write
   write to file 
end mouseUp
I dont understand how to layout the save after "write to file" I want the path to be "C:\Programfiles\GNTool" and I want to save the file as "server"
also, how do I send a message with the "get url" so that once the download is complete a message comes up.


-Thanks, Im a complete newbie and Im loving how helpful the community is here.

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 9:57 pm
by Alex_CTZ
Sorry to bug but any help?

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 10:51 pm
by Simon

Code: Select all

create folder "C:/Program Files/GNTool"
set the defaultFolder to "C:/Program Files/GNTool"
put url "http://www.blabla.com/index.html" into url "file:index.html") 
Is that what you are trying to do?

Simon

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 11:02 pm
by Alex_CTZ
Simon wrote:

Code: Select all

create folder "C:/Program Files/GNTool"
set the defaultFolder to "C:/Program Files/GNTool"
put url "http://www.blabla.com/index.html" into url "file:index.html") 
Is that what you are trying to do?

Simon
Im trying to make it so when a user clicks the button it downloads a file and saves it in "C:\Programfiles\GNTool"

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 11:07 pm
by Simon
Well did the code I wrote work?

Simon
Oh I see I left a trailing ")"... remove that.

Re: 1 Question <----NOOB

Posted: Thu Apr 17, 2014 11:55 pm
by Alex_CTZ
Simon wrote:Well did the code I wrote work?

Simon
Oh I see I left a trailing ")"... remove that.
It does altohugh its not for html its for a .exe file

-Thanks

Re: 1 Question <----NOOB

Posted: Fri Apr 18, 2014 12:00 am
by Simon
Use
...into url "binfile:index.exe"

Simon