Page 1 of 2
Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 12:06 am
by shawnblc
Trying to do something like this and not having much luck, even locked LC up for a bit. When I do this I get the correct code, back in the message box, but when I try and call the handler nothing happens.
Code: Select all
on myCode
put line 1 to 20 of URL "http://mydomain/myfile.txt" into tLcCode
put tLcCode
end myCode
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 12:09 am
by FourthWorld
How quickly does Thai URL return in a browser?
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 12:12 am
by shawnblc
FourthWorld wrote:How quickly does Thai URL return in a browser?
Pretty dog-gone quick, it's a text file. I'll try wait.
Update: no luck, tried moving it to the preOpenStack too. No luck.
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 12:14 am
by Simon
Code: Select all
put line 1 to 20 of URL "http://mydomain/.txt" into tLcCode
Just a typo or do you really have a .txt file with no name?
Simon
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 12:16 am
by shawnblc
Simon wrote:Code: Select all
put line 1 to 20 of URL "http://mydomain/.txt" into tLcCode
Just a typo or do you really have a .txt file with no name?
Simon
It's a typo.
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 12:19 am
by Simon
It's working here on my site.
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 12:32 am
by shawnblc
Simon wrote:It's working here on my site.
Let me double check everything in the txt file and make sure I didn't make an error there. Hmmmm. Update in a few minutes.
Update: I can take exactly what I have in the txt file and paste in the handler and it works, when I get the code from the txt file though it just pops up in the message box. Nothing else happens as it should.
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 12:39 am
by Simon
U get my pm?
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 12:48 am
by shawnblc
Simon wrote:U get my pm?
Just responded to your PM. Doesn't work for me either. I'm using LC 7.0.2 rc 1 build 10024. Does exactly like mine does and just pops up in the message box.
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 1:11 am
by Simon
I just tested with LC 7.0.2 rc 1 build 10024 commercial and it is working.
Maybe I'm misunderstanding the question?
is it;
If you put all the code in a button it works but if you put "on myCode" into the card or stack script it doesn't work?
Simon
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 1:20 am
by Simon
Does exactly like mine does and just pops up in the message box.
Wait a sec... that is what it is supposed to do.
Where did you want the 20 lines to show up?
Simon
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 1:22 am
by shawnblc
Simon wrote:I just tested with LC 7.0.2 rc 1 build 10024 commercial and it is working.
Maybe I'm misunderstanding the question?
is it;
If you put all the code in a button it works but if you put "on myCode" into the card or stack script it doesn't work?
Simon
Example: On my button script I have this:
On the stack script I'd have this on, say open stack
Code: Select all
on openStack
mLcCode
end openStack
in my text file I'd have this:
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 1:25 am
by Simon
shawnblc wrote:
...
in my text file I'd have this:
Getting weirder...
You want to download a text file and run it as a script?
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 1:29 am
by shawnblc
Yup. Just experimenting. Copied from another one, seems like it should work. Not working either, but I'm sure it's me.
Code: Select all
on closeStack
mYahoo
end closeStack
Code: Select all
on mYahoo
put URL "http://domain.com/launch.txt" into tURL
put tURL
end mYahoo
Text file contains:
Re: Another one for ya: using put from server to stack
Posted: Mon Jan 19, 2015 1:35 am
by Simon
OOOOHHHHHH!
OK
Haven't tested it but
Add a new button (could be anything)
in your text file have this
on mouseUp
launch URL "
http://www.livecode.com"
end mouseUp
Then download all three lines and
Code: Select all
set the script of the last button to tLcCode
send mouseUp to the last button
???