November 6, 200619 yr Added a button to layout, to which script attached. Goal is to enable viewing PDF doc whose name is present in current rec. Attached script to button that: 1) declares var, loads with value in field of rec being viewed 2) runs send event with these specs: Adobe Reader is Target App Send the [open document] event with *Calculation (where declared var value should be passed<--this is where problem arises!!! Bring Target App to foreground checked Wait for event completion... checked Result Error: The file "& $Var" ($Var is variable name) could not be found and is required to complete operation I'm not clear on how to pass var in Send Event so value interpreted is ONLY filename, NOT & $Var Also wondering if need to pass path to PDF doc. Now running on OSX Thanks much
November 6, 200619 yr Author Send Event ["Adobe Reader 7.0.8"; "aevt"; "odoc"; $VarFnm] Have since orig posting learned if I store only ref to PDF in Container field, no code is needed to double click and open PDF file with AdobReader. Nonetheless, I think it may be useful to understand how to pass a var value in Send Event context (if it's even possible!) Thanks
November 6, 200619 yr MarcZ, I am not sure exaclty what your question is. In your similar other post, I had asked you why you didnt just use a container field that had a file reference. If you wanted to use a variable, you need to set a variable to the path to the file. Then you can send event. So, you can have something like this. Set Variable [ $Var; Value:"filemac:/Generic Volume/pdfs/test.pdf" ] Send Event ["Adobe Reader 7.0.8"; "aevt"; "odoc"; $Var ] or Set Variable [ $Var; Value:"filemac:/Generic Volume/pdfs/" & fieldA ] Send Event ["Adobe Reader 7.0.8"; "aevt"; "odoc"; $Var ] Where fieldA is a field that contains the actual name of the file such as test.pdf if you wre looking for a text field that contains the field name.
November 6, 200619 yr Author John-- For all your uncertainty, you found way to teach me precisely what I was hoping someone would, so thanks very much. The FM work I'm doing serves only me for the moment, and it's a bit scattershot, but I hope I'll eventually be able to help someone in a similar fashion down the road. Regards, Marc
Create an account or sign in to comment