Jump to content

This topic is 4316 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a container field where I store pdf files by reference.  I'm trying to write a script that is triggered by OnObjectEnter which will open to my pdf folder.  Here's what I have:

 

 

Set Error Capture [ On ]
If [ IsEmpty ( Court Calendars::Clerk's Calendar ) ]
   Set Variable [ $CalFilePath; Value:Year ( Get ( CurrentDate ) ) ]
   Insert File [ Court Calendars::Clerk's Calendar; “filewin:/o:/Court_Calendars/$CalFilePath/*.pdf” ] [ Reference ]
End If
 
I've tried using wildcards *.* for the file name, a dummy file name, and even no file name at all, but it never opens the intended folder.  I was hoping that if I used a dummy file name which couldn't be found that my pdf folder would open so I could select a file.
 
Thanks for your help,
Kevin
Posted

Your calculated string is incorrectly formed, it should be:

 

"filewin:/o:/Court_Calendars/" & $CalFilePath & "/*.pdf" (You must concatenate strings using the '&' character)

 

But this still won't work as you can't wildcard the filespec, nor can you not specify a file as the last element in the string after the last '/' is interpreted as the required filename.

 

If you use Export Field Contents then you can change the 'focus' of the users file dialog box. So, just export a 'dummy' container (could be a global field) to the target folder immediately before offering the Insert File.

 

Your export filepath should read:

 

"filewin:/o:/Court_Calendars/" & $CalFilePath & "/dummy.pdf"

 

There's also a cute 'trick' to remove files - export an EMPTY container!!

 

Incidentally, are you aware that storing by reference will possibly lead to lost files if the files are removed from the folder?

 

HTH

Posted

My apologies on this...

 

A SCRIPTED Export does not change the file dialog focus, but it does when performed manually!

Posted

Thanks so much for this information and for taking the time.

 

I will read the referenced post and see if I can adapt it to my needs.

 

Have a great day.

 

Kevin

This topic is 4316 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.