Skip to content
Discussion options

You must be logged in to vote

Not with the built-in Rename action right now. The supported tokens are {name}, {extension}, {date_created}, {date_modified}, {current_date} and {size}, and the date format is hardcoded to yyyy-MM-dd in ActionExecutor.swift. Date tokens like {year}/{month} are on the README roadmap, so it might come later.

In the meantime you can do it with a Run script action, since Forel passes each file in $FOREL_FILE and you get the full date formatting:

file="$FOREL_FILE"; dir="${file%/*}"; name="${file##*/}"
target="$dir/$(date +%Y%m%d_%H%M%S)_$name"
[ -e "$target" ] || mv "$file" "$target"

That gives 20261021_134500_report.pdf. Change the date +... part to whatever you need (%Y%m%d, %Y.%m.%d, %H%M.…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@johntamplin
Comment options

Answer selected by johntamplin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants