Re: Choose Folder - FMP field value to document
Re: Choose Folder - FMP field value to document
- Subject: Re: Choose Folder - FMP field value to document
- From: Cornwall <email@hidden>
- Date: Fri, 27 Sep 2002 10:21:30 -0700
At 8:28 AM -0700 9/27/02, Don Wieland persistently wrote:
>
Here are the steps I need to happen:
>
>
- The user clicks a button in FMP and an applescript dialog displays
>
prompting them to CHOOSE a folder in which FMP will export files into.
set foo to choose folder
>
>
- When they CHOOSE the folder, I would like to capture the path of the
>
folder in a GLOBAL field called "gPath".
set cell "gPath" of current record of database 1 to foo as string
>
>
- After this is captured I would like to be able to EXPORT the value of one
>
field called "gSource" to that path using a name that is calculated in FMP
>
(let's call that field "gFileName"). For example if:
set {pairentPathe, docNam, sourcTxt} to {cell "gPath", "gFileName", cell "gSource"} of current record of database 1 --watch the wrap
set docPathe to pairentPathe & docNam
>
>
gFileName = "DocA.html"
>
gSource = "Blah Blah Blah..."
>
>
A following file will be created in the following location:
>
>
gPath:DocA.html
>
>
and the contents of the file will be "Blah Blah Blah..."
set filRef to (open for access file docPathe with write permission)
write sourcTxt to filRef starting at eof
close access filRef
[[ However, you'll have to rewrite the above 3 lines to use raw
code - a FileMaker compile time bug - if you want to embed your
script. :-) ]]
set filRef to (<<event rdwropen>> file docPathe with <<class perm>>)
<<event rdwrwrit>> sourcTxt given <<class refn>>:filRef, <<class wrat>>:<<constant rdwreof >>
<<event rdwrclos>> filRef
-- "<<" and ">>" represent ASCII 199 and 200.
>
>
I'd like this to be OS safe meaning compatible with all version of
>
Applescript.
Natch. This is totally untested, but it should get you started writing it yourself.
Corny
--
Cornwall C. Cornball
Axiomatic Ideas & Checkbook Balancing
The answer to everything, and the solution to nothing.
<~:~> <~:~> <~:~> <~:~> <~:~>
The future is so bright I have to wear shades!
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.