Newbies FMP-NewbieGuy Posted October 14, 2003 Newbies Posted October 14, 2003 First of all... I apologize if this is not the correct forum to ask this question. MODERATORS: Please move this to it's correct forum if it is NOT in the right place and notify me of where it got moved to. Thanx!!! Now... I am looking to find out two things about my query: a) If it is possible : where to get more info on how to implement, if it IS possible Here where I just started to work, they use FMP on Macs & Wintel boxes. I am trying to implement a new process for logging information on submitted files to our department. The way (I think) I want it to work is, I open-up an existing client (record) and click on a logging button to bring me to this screen I want to create. On this screen, I want to be able to use drop-downs and note fields to define attributes of the file(s) in question... BUT... since we generally get sent anywhere from 2-files to 52-files, I don't want to manually enter every filename for two reasons: a) time : accuracy I'd like to be able to have a button that would spawn a dialog box that asks you to navigate to a directory... and once you choose that directory, it will create an entry for EVERY file in that directory using each filename & extension, to which I can assign my attributes. I'm not sure if I described it well, but I'll give you a scenario: I go to this "Logging" screen which has existing job info. I now need to generate a "List" of files that I can assign criteria and/or notes to. Each file(name) will be a seperate entry with attributes. So... I click this button and navigate to a directory with 15 files in it and click "OK". What I hope to appear in my FMP list are the 15 entries with the "FileName" field pre-populated with the filename(s) and extension(s) of the contents of that directory. Now I can assign values to each file via pull-down menues, checkboxes and add notes, etc... Is this possible, and if so... where do I begin to do my homework on implementing such functionality...? This does NOT need to be "live" where it auto updates nor does it need to be "smart" to know it's already imported those names. If I hit the button again and choose the same directory... it will create an additional 15 entries with the same name. This is not a problem. Basically, I just need something to automate the list entires using the filenames of the directory I choose. (hope this made sense) Thanks in advance. - Scott
Newbies FMP-NewbieGuy Posted October 14, 2003 Author Newbies Posted October 14, 2003 -BTW- Not sure if it's relevant, but... I will be running this "script?" from a Mac-Client of FMP... but it would need to be IMPLEMENTED off of a PC (I think the admin is a PC-user) so I don't know what sort of cross-platform issues come-up when telling the app to navigate to a directory and grab filenames, etc. Just something to think of. Thanks again...!
Anatoli Posted October 14, 2003 Posted October 14, 2003 I am sorry, but I am completely lost. It doesn't look to me like database problem and could you imagine running that in multi-user situation with all databases opened on FM server. I am lost or you are lost in FM functionality.
Newbies FMP-NewbieGuy Posted October 14, 2003 Author Newbies Posted October 14, 2003 Let me try to make it simple: I want to create a screen (linked to an existing FMP Database) where I can create entries to add to the current open record (client). These entries will be text fields that I can use pull-downs or checkboxes or radio buttons or whatever to use as attributes. So, I might enter: text field: "Filename" = MyImage.psd attribute #1: "Color Mode" <pulldown> = CMYK attribute #2: "Resolution" <pulldown> = 300 dpi attribute #3: "File Format" <pulldown> = Photoshop --------------- new entry (same customer) ---------------- text field: "Filename" = AnotherImage.jpg attribute #1: "Color Mode" <pulldown> = RGB attribute #2: "Resolution" <pulldown> = 72 dpi attribute #3: "File Format" <pulldown> = JPEG --------------- new entry (same customer) ---------------- text field: "Filename" = LastImage.ai attribute #1: "Color Mode" <pulldown> = CMYK attribute #2: "Resolution" <pulldown> = line art attribute #3: "File Format" <pulldown> = Illustrator v5.5 Now... we could build this today... BUT, I don't want to MANUALLY type-in each filename due to time and potential mistyping & accuracy. I would like to find a way to automate the "Generation" of this "list" of files by having a script "ask me" what files I want to use to generate a list... I navigate to the directory via an OpenDialog box and either select a directory or a range of files... or even a SINGLE file, and the script would add all the files as seperate entries in that list waiting to have those attributes assigned to them manually. So the list would build based on how many files I selected, be it 5 or 50. I just want to know if FMP is able to "Read-In" just the FILE NAMES of files in a directory and have it generate a new list entry for each file it encounters. Is that any less confusing...? I apologize for not being able to convey this more clearly. - Scott
Fenton Posted October 14, 2003 Posted October 14, 2003 This could be done for free on a Mac with AppleScript. But it can also be done cross-platform, using a plug-in. I use Troi's File plug-in ($55). There is another plug-in similar. It can bring up the dialog: External("TrFile-SelectFolderDialog", "-unused") Convert selected folder to full path: External("TrFile-FileSpec To FullPath", _gSelectedFolder) And get the filenames*: External("TrFile-ListFolder", "files|"&_gFolderImport & "") This will put them into a return-separated list, which you can parse to create records, and do whatever. http://www.troi.com There are a bunch of example files included in the demo, which is full-featured for 30 days. There is also a possibility of using FileMaker 6 and the Import files from a folder. But you still need a plug-in, because this kind of Import requires a fixed-named folder to set up. And it presupposes you want to import either image or text files. *The ListFolder example file is named "DataIn.fp5."
Newbies FMP-NewbieGuy Posted October 14, 2003 Author Newbies Posted October 14, 2003 Thanks... That's a GREAT lead for me (us)... I just got off the phone with FMP Tech Support and they were less optimistic about this being possible... he actually said he didn't think it was at all possible. Glad to have "Power Users" here to bounce my ideas off-of. Now all I need to do is figure-out how to implement this idea. Any good FMP professionals in the Salem NH area...? Heheheh... Thanks.
Anatoli Posted October 14, 2003 Posted October 14, 2003 I see, on Windows it can be something like: FM Script Send Message [ Event Specification: Program: MS-DOS Batch File, Event Class: aevt, Event ID: odoc, Filename: "d.bat" ] Pause/Resume Script [ "0:00:03" ] Import Records [ Filename: "directory.txt"; Import Order: That script is calling file "d.bat" with: dir > directory.txt which produces directory listing into file directory.txt and that text file is imported into FileMaker database. Then you can work out some cleaning which depends on OS.
-Queue- Posted October 14, 2003 Posted October 14, 2003 If you've only one command, a batch file is superfluous. Send Message [ ] with cmd /c dir > directory.txt (for WinNT; I would assume command /c for Win9x) works just fine.
Newbies FMP-NewbieGuy Posted October 14, 2003 Author Newbies Posted October 14, 2003 Hmmm... My apologies for wasting all of your collective time. As I read these replies... I realize that I am way, way... WAY... over my head with this stuff. My ability to "code" anything is "Enough to be dangerous". I may have to look locally for someone who can even understand the replies you all gave me. It's not you... it's me... ) Thanks...
Anatoli Posted October 14, 2003 Posted October 14, 2003 That is simpler for one Windows OS, sure. Maybe do the branching in script like Status (CurrentPlatform) Good Old Batch file will work on all Windows OS, but it must be present on all computers...
-Queue- Posted October 14, 2003 Posted October 14, 2003 it must be present on all computers Or at least accessible via a common mapped drive...
Fenton Posted October 15, 2003 Posted October 15, 2003 It is sad that the people you talked to at FileMaker thought this was so difficult. I can only assume they are either new themselves or dangerously ingrown if they think FileMaker can only interact with objects within its own application space. They will not do well in the business world with that kind of advice. I believe what Anatoli and Queue are saying is that on Windows the Send Message step with the text: cmd /c dir > directory.txt will produce a text file of the file names, which you can then import into FileMaker. Not having a Windows computer turned on at the moment, I'd recommend trying their suggestion, but can't say what it will actually do, or how you could modify it. If it doesn't do what you want, I'd say download the Troi File plug-in. As I said, it has lots of examples, and is fairly flexible; so you can do things like move the files after importing, etc.. You could call FileMaker back and tell them there are so many ways to do this that we are fighting over it -) Let us know how it goes, but try the examples first. You'll be surprised.
DonH Posted October 15, 2003 Posted October 15, 2003 Basically if you do a cmd /c dir > directory.txt and then import it, all the info comes in and you have some serious cleaning to do. EX: Volume in drive C has no label. Volume Serial Number is 6884-764D Directory of C: 06/09/2003 08:59p 5,177 ACF28B1.zip Now the import takes each of these lines as an entry. So if you have a text field for instance named FILE you would get the first one with "Volume in drive C has no label." This is not bad if you know it is coming. You can always skip/delete the first X number of entries. Then you must figure out how to parse the field that looks like 10/08/2003 10:21a 19,983 Image7.jpg Not so hard there either since you know the sizes (length) of everything. Like the date is 10 characters. Time is 6 characters. So you can make one field called something like importData and then make a field called DATE as a calculated field with the calculation being = MIDDLE(importData,1,10) And so on.
Recommended Posts
This topic is 7713 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