June 4, 200421 yr oh man.. i give up... i just wanted to rename my exported filemaker file to include current datetime as part of its filename. i read somewhere in this forum that i could do this using applescript but hell.. i have only been a mac user for a month.. i guess its not a duration long enough for me to fully understand the language that apple uses and how does the scriptmaker functions... think i need help here.. an applescript which renames file will be good and i will work out from there...
June 4, 200421 yr There are standard apple scripts for the renaming of files. Look in your programs folder, apples scripts, finder scripts and try the "trim filename" or the "Add to filename" scripts. Good luck.
June 4, 200421 yr I'm attaching a file. It should be fairly simple. I ran into an odd problem, which I haven't seen before. Which was an error, type 2, when the exported text file already existed, and AppleScript was attempting to change its name. Probably a timing problem. So I added a little AppleScript to delete the file if it exists (which is before FileMaker would export and overwrite it anyway). Then there's no error. There's no error when just overwriting from FileMaker, so it's the interaction. The DateTime is done as text, with "_" as a separator; you can adjust to whatever. ExportRename.zip
June 7, 200421 yr Author wow cool.. ur script is so easy to understand unlike those sample scripts provided by apple.. thanks a million!
June 7, 200421 yr Well, thanks. One reason that some AppleScripts are so complicated is that they have error checking for this and that, often because they have user interaction (and one knows what trouble that can cause). Another is that they may not be written for FileMaker, which in this case is storing critical info, such as "where is the file?" and "what is the new name?" Also the particular form for the date & time, to be acceptable in a file name. This could also have been done in AppleScript, about the same; but doing it in FileMaker keeps the AppleScript cleaner, easier to read and understand.
Create an account or sign in to comment