- Created by BenjaminOddou
- đ Last Updated: 03/08/23 23:51:42
- đ Stars on GitHub: 19
- Please consider supporting the creator by Starring or Sponsoring them on GitHub!
- Get Latest Release
- Get Source Code
From their README
Welcome to the File Explorer repository: An Alfred Workflow â¨
â Prerequisites
- MacOS.
- Alfred 5. Note that the Alfred Powerpack is required to use workflows.
- Any spreadsheet software which can open
.xlsx
files like Microsoft Excel, Numbers, WPSOffice, LibreOffice... - Requires python 3.6 or above.
âŦī¸ Installation
- Download the workflow
- Double click the
.alfredworkflow
file to install
đ§ââī¸ Invoke the workflow
There is 2 flows in this workflow :
- The first one allows you to grab filenames. It can be triggered by writing
getfilenames
keyword. - The second allows you to rename files based on the data in a selected spreadsheet. You can invoke this flow with the
renamefiles
keyword.
You can edit these triggers (flagged with a đšī¸
symbol) in the user configuration panel.
𧰠Setup the workflow
- Install Python 3.6 or above. Check your version with :
python --version
đ¤ Usage of the workflow
Register filenames in a Spreadsheet
Ensure that you select the right Level for the parameter đ Depth of the search
. If you want to include files in subdirectories increase the depth level.
Optionally, you can write a regex expression to the đĢ Reject Files
parameter. If the files matches you regex parameter, it will be excluded from the result. For example the following regex expression ^.|^~|desktop.ini
will allow you to exclude common hidden and temp files.
Note that if you let it empty, all files will be listed
Using Workflow File Filter
Invoke the first flow with the đšī¸ Trigger 1
and search for the folder or the file you want to register the filenames of and press â.
Alternatively, use the Alfred Buffer
to select folder(s) and files(s) at the same time !! Basic commands are :
- âĨâ to add a file to the buffer from Alfred's results.
- âĨâ to add a file and move to the next item in your list of results.
- âĨâ to remove the last item from the buffer.
- âĨâ to action all items in the buffer.
- âĨâĢ to remove all items from the buffer.
To know more on how to use Alfred Buffer
, follow this link.
Note that
Alfred Buffer
is preferred compare to the{query}
, meaning that if you select a folder/file (by clicking on it or by pressing enter â) that is not included in the buffer, it will not be included in the xlsx file.
Using Alfred Universal Actions
Select the folder(s) / files(s) you want to grab the name of within alfred using Quick Search
and run Universal Actions
with â or âĨâ if you used the Alfred buffer
. Select "Get filenames in a spreadsheet".
If you want to know more on how to use Alfred Universal Actions, follow this link.
Renaming files
Edit the column D of the xlsx generated file with new filenames and include file extension. Please, don't insert, delete, or edit any other columns.
Note that changing a file extension (png to jpg for example) can potentially break the file ! You can prevent this by ticking the
đĄī¸ Safe renaming
. If you still want to change the file extension (jpg to JPEG for example), untick it.
Invoke the second flow with the đšī¸ Trigger 2
and select the xlsx file that should be used for the renaming operation and press â. Hold the â key and press â to reveal the file in the finder. Alternatively you can open the file in the default application by pressing âĨâ.
Review your parameters and launch the renaming operation by selecting Rename Files
.
Note that if you want to change back from new names (in column D) to old names (columns B+C), you can tick the
âŗ Reverse names
checkbox`.
Logs output
Check the logs of your compression under the Data folder
. The log file can contains two types of messages :
- If everything went well you'll have the following message :
INFO(root)â Renaming successful: {old_file} â {new_file}
- If an error occurs, you'll have :
INFO(root)đ¨ Error renaming {old_file}: {error_description}
Note that renaming operation will always create a log file that is named
{name_of_the_excel_file}{log_timestamp}.log
âī¸ License
MIT License Š Benjamin Oddou