Page 1 of 1

specialFolderPath

Posted: Wed Apr 23, 2014 11:02 am
by francof
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

Re: specialFolderPath

Posted: Wed Apr 23, 2014 11:08 am
by Klaus
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

Re: specialFolderPath

Posted: Wed Apr 23, 2014 11:13 am
by dave.kilroy
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

Re: specialFolderPath

Posted: Wed Apr 23, 2014 11:32 am
by francof
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