Page 1 of 1

"Put URL" command can't find my file?

Posted: Fri Jan 16, 2009 1:51 am
by Mistfall
Hi all!

I'm trying to get data from My_file.txt , which is in the same folder as my Rev stack. Here's what I wrote:

on mouseUp
put URL "file: My_file.txt" into theFile
put theFile into field "heresMyFile"
end mouseUp

Field "heresMyFile" comes up empty. When I tried to debug by saying:

put URL "My_file.txt" into theFile
put the first word of "theFile" into message

Message gives me empty, although I have opened My_file.txt and seen that it does indeed contain text.

Since it is in the same folder as my Rev project, I didn't think I had to state the entire file path, so I'm not sure what is wrong!

I'm grateful for any help! Thanks!

Posted: Fri Jan 16, 2009 6:30 am
by Janschenkel
The first thing I spotted was a space between the colon and the name of your file - but I think that's just a typo when copying to the forums?
Other than that, the fact that the file is in the same folder as the project is no guarantee that the engine will start looking in that folder - you will have to set the defaultFolder global property to that folder before using a relative file URL.

Jan Schenkel.

Thank You!

Posted: Fri Jan 16, 2009 1:38 pm
by Mistfall
Thank you! I think I have both of those problems going on.

I didn't know about having to set the default folder!