steigrafx Posted April 5, 2013 Posted April 5, 2013 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
IdealData Posted April 6, 2013 Posted April 6, 2013 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
IdealData Posted April 6, 2013 Posted April 6, 2013 My apologies on this... A SCRIPTED Export does not change the file dialog focus, but it does when performed manually!
IdealData Posted April 6, 2013 Posted April 6, 2013 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.
steigrafx Posted April 8, 2013 Author Posted April 8, 2013 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now