April 5, 201312 yr 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
April 6, 201312 yr 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
April 6, 201312 yr My apologies on this... A SCRIPTED Export does not change the file dialog focus, but it does when performed manually!
April 6, 201312 yr However there,s an interesting post on how drive the OS to create a folder/file http://fmforums.com/forum/topic/88006-create-a-folder-on-desktop-for-a-mac-from-a-pc/?hl=send+event+cmd#entry404248 Maybe you can adapt it.
April 8, 201312 yr Author 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
Create an account or sign in to comment