specialFolderPath

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

specialFolderPath

Post by francof » Wed Apr 23, 2014 11:02 am

Hi there,
That's my problem:
have a button to choose a file, into the mouseUp event I have this

Code: Select all

on mouseUp
        put specialFolderPath("Documents") into tFilePath
  
   answer file "Please choose a file"

   if the result is not "cancel" then
      put it into tFilename
      put url ("file:" & tFilename) into field "text"
      end if
end mouseUp
in tFilePath I find the correct path (the system folder Documents), but the file selection window show me the last folder opened.
what's wrong?

thanks for your attention
franco

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: specialFolderPath

Post by Klaus » Wed Apr 23, 2014 11:08 am

Hola Franco,

1. welcome to the forum! :D

2. You are only putting your path to the documents folder into a variable but do not use it! 8)
This is an extra parameter for the ANSWER XXX dialog:
...
put specialFolderPath("Documents") into tFilePath
answer file "Please choose a file" WITH tFilePath
...
Will do what you want.


Best

Klaus

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: specialFolderPath

Post by dave.kilroy » Wed Apr 23, 2014 11:13 am

Woa Klaus but you're fast! I was just in the process of replying to Franco when I noticed your answer popping up - I'll have to type super-extra-fast in future :D
"...this is not the code you are looking for..."

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: specialFolderPath

Post by francof » Wed Apr 23, 2014 11:32 am

ciao Klaus,
1) thanks for the welcome.
2) and for your help, it works great. seeing your suggestion I realized how much was obvious: I was not using the specialFolderPath.... D'oh! :oops:

hi Dave, you came the second.... try again :D

bye franco

Post Reply