On Tue, 14 Oct 2008 15:17:04 -0400, "Guy" wrote:
>I know it's an old topic, but I stll can't get a good answer.
>
>Simple ...script step to open a file dialog to capture the file path for
>subesquent attaching as an email.
>
>How do I capture the file name and path?
>
>fm8.5 ADV WinXP sp2
It's kind of a chicken-or-egg issue, isn't it? We want to capture the
file path from an Open File dialog for use in some kind of automation,
so it doesn't have to be entered manually. But how does the Open File
dialog navigate to the right place? Someone has to do that. So we're
back where we started. I'm guessing that what's needed is an absolute
path; a relative path won't work for you.
This (or something similar) *should* work, I haven't had a chance to
try it though:
1) Set Variable # create a relative path to the desired directory
(based on the directory the database is in)
2) Send Event ( cmd.exe cd [ absolute path to your database ] # so
the variable will work in the next step
3) Send Event ( cmd.exe cd [ your variable ] ) # open the desired
directory
4) Send Event ( cmd.exe cd > pathcap.txt ) # save the absolute path
to a text file
5) Import Records ( pathcap.txt ; pathcap_g ) # import the absolute
path into a global to hold it
6) Send Event ( cmd.exe del pathcap.txt ) # clean up afterwards
If you try it let me know if it did the job.
hope this helps
--
FW
FileMaker Pro 8.5 Advanced on Windows XP Pro SP2
FileMaker Server 8.0 on Windows 2003 Server R2
>> Stay informed about: Open file dialog for capturing file path