I’m trying to make a New Smart Rule that would remove the first 9 characters, or the first word, of any filename when I select Apply Rule. Any suggestions as to how I could accomplish this?
Example filename before:
20211207 Seven ways to get traction for your early-stage product
Example filename after:
Seven ways to get traction for your early-stage product
I’m not getting yyyymmdd to be seen as a date, or at least I’m not through the New Smart Rule options. Since I can’t get the first eight characters to be seen as a date is there a way to delete word 1 of x number of words of filename, or delete characters 1 to 8 of filename?
I have zero experience with Applescript so unless it’s easy to execute it may not be an option for me.
The original date formatting I used to add to the filename had an error in the formatting (current month instead of creation month). I would like to strip out the old date and then add in the correct date (creation date: creation year, creation month, creation date)
DTLow:
Yes, I thought it possible to do both actions at the same time. Just need to test out with a smaller group of items before letting the script loose on all of the misdated files. Here’s what I’m using for adding the correct file date.
Sorry @DTLow, I need a little more help. I can’t figure out how to place the lines you suggested, or point to an AppleScript file to perform what you recommend.
The Scan Name > String has a single space followed by an asterisk. The asterisk denotes data to be preserved.
Then a Change Name action has the date components, arranged as desired, followed by a single space, and ending with the Document String placeholder. This replaces the placeholder with the preserved text from the Scan Text action.
Result
Easy as pie (or a cake or cookie, if you prefer) !
PS: I used a batch process instead of a smart rule anticipating this would not be a routine action to perform. Batch processing is made exactly for these moments.
Using the Smart Rule Edit Script action, the following framework is automatically generated
on performSmartRule(theRecords)
tell application id "DNtp"
repeat with theRecord in theRecords
<<<< This is where you insert your statements
end repeat
end tell
end performSmartRule
Instead of torturing yourself with AppleScript, you should check out the Batch process mentioned by @BLUEFROG. That is really a lot simpler than trying to reinvent the wheel.
You’re welcome.
And a reminder: How do you eat an elephant? One bite at a time.
So don’t try to process all 180,000 in one go. Give it smaller batches. You could even add something like a Change Label action to mark the ones that have been processed and demarcate what ones still need processing.