XP, Vista, Choosing where to save rev files
Jim Ault
jimaultwins at yahoo.com
Sat Sep 12 09:50:40 EDT 2009
On Sep 12, 2009, at 6:17 AM, Richard Gaskin wrote:
> sims wrote:
>> If I let a Windows user choose via dialog where my app creates and
>> saves a rev file, will any folders that can be chosen by the user
>> be accessible to the rev app when it goes to open that file again?
>> I'm a bit worried about users choosing to save the file into a
>> folder that Vista will then not allow the rev app to open that file.
>> Maybe I'm being overly paranoid ;-) But Vista seems a bit cranky.
>
> Vista *is* cranky, but I've had good results as long as I stick to
> folders within the user space.
> You can direct the user to their Documents folder by specifying the
> path there in the ask file dialog, using the specialFolderPath
> function:
>
> ask file "Save file as:" with specialFolderPath("Documents")
>
> That's no guarantee the user won't switch to a more troublesome
> folder, but in my experience many Windows users tend to stick to
> whatever folder you prompt them to.
You could use a conditional loop and test, such as
on testValidity
put false into successful
put "itty bitty string" into stringToWrite
repeat until successful is true
ask file "Save file as: " with specialFolderPath("Documents")
put it into userChoice
if it is empty then exit to top -- user cancelled
put stringToWrite into url ("file:" & userChoice)
put url ("file:" & userChoice) into gotItBack
if gotItBack is not empty then put true into successful
--else user chose a file and path that could not be used
-- either the filename is invalid or the folder or both
end repeat
--if we get here, we can use the folder and file name
... more steps
end testValidity
Jim Ault
Las Vegas
More information about the use-livecode
mailing list