Title: Script running through finds from a dos dir command needs helpPost: I have a file which is a dir output from dos containing filenames plus directory structure.
I am housekeeping a directory with subfolders and converted files from ts to mp4
I want to find similar name files and action the original based on its extension.
The problem is twofold:
The directory structure contains "\", and I don't know how to have this treated as a simple char rather than a reserved charI want to go through each find set, check the filetype (already defined in a separate field), and then return to the next record from the whole set, having marked off any records examined as 'processed', but I do not know how to recover the position. I tried setting a variable ($$recid), but when I try to use this with goto record it comes up in the dialog as zero second time around, even though the variable is being correctly assigned.
(just to add some files have a conversion extension on the filename, e.g. "filename - converted", so exact matches on filename (minus extension) will not catch all. I am ok with this, but I wanted to mention it in case anyone suggested help that involved it)
I havent added the action part as yet, I am just trying to egt the loop to work correctly:
At the moment, these are the 2 blockers to my script - any help?
Answer
1) "\\" will evaluate as \. You may find it useful to do this: Substitute ( FilePathField ; "\\" ; "/" ) to replace the dos/windows directory separator with the / used in FileMaker file path expressions. \ is the "escape" character in FileMaker text expressions so to get the actual \ character, you type it in twice in text expressions, escaping the escape character.
2) Go to record/request/page specifying a number, specifies the position of a record in your current found set, not it's record ID. If your found set is unchanged by what you are doing use Get ( RecordNumber ) to capture the original position of your record.
If the found set is modified before you attempt to return to that "next record" you have to either preserve or restore that found set before you can go to that specified record. I've used two different approaches depending on platform and window management preferences:
Use two windows--one with your original found set to loop through one record at a time and one to manage a different found set of the same records. Your script then flips back and forth between windows--one or both of which may be hidden from the user.
Use two layouts based on two different occurrences of the same table and switch back and forth between the two layouts while using Freeze Window to keep the layout switches invisible. (A table occurrence is what we call the "boxes" found in Manage | Database | relationships that you use to define relationships. One such occurrence is specified in "show records from" in Layout Setup... for every layout in your database.
THe second option is what I use if I have a Windows system with Maximized windows as it avoids a windows resize issue created when you open new windows.
Your new post is loading...