Giter Club home page Giter Club logo

alfred-file-explorer's Introduction

logo-dark

logo-light

made with heart by Benjamin Oddou saythanks Python 3.6+

Welcome to the File Explorer repository: An Alfred Workflow โœจ

โœ… Prerequisites

โฌ‡๏ธ Installation

  1. Download the workflow
  2. Double click the .alfredworkflow file to install

๐Ÿง™โ€โ™‚๏ธ Invoke the workflow

There is 2 flows in this workflow :

  1. The first one allows you to grab filenames. It can be triggered by writing getfilenames keyword.
  2. 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

  1. 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 โŽ.

normal_search

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.

alfred_buffer

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".

universal_action

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 โŒฅโŽ.

rename_xlsx_selection

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`.

rename_params

Logs output

Check the logs of your compression under the Data folder. The log file can contains two types of messages :

  1. If everything went well you'll have the following message : INFO:root:โœ… Renaming successful: {old_file} โ‡’ {new_file}
  2. 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

alfred-file-explorer's People

Contributors

benjaminoddou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

alfred-file-explorer's Issues

ERROR: Filenames Renaming[Run Script] 975:976: syntax error: Expected end of line but found number. (-2741)

[17:17:05.228] Filenames Renaming[Script Filter] Processing complete
[17:17:05.230] Filenames Renaming[Script Filter] Passing output '' to Conditional
[17:17:05.230] Filenames Renaming[Conditional] Processing complete
[17:17:05.231] Filenames Renaming[Conditional] Passing output '' to File Filter
[17:17:07.957] Filenames Renaming[File Filter] Processing complete
[17:17:07.959] Filenames Renaming[File Filter] Passing output '/Users/huangxin/Documents/software' to Run Script
[17:17:08.114] ERROR: Filenames Renaming[Run Script] 975:976: syntax error: Expected end of line but found number. (-2741)
[17:17:08.175] Filenames Renaming[Run Script] Processing complete
[17:17:08.175] Filenames Renaming[Run Script] Passing output '' to Post Notification

Why did this error occur?
And i want to use WPS to create Excel instead of MicrosoftOffice, what should I do?
Looking forward to your reply*^o^*๏ผemail: [email protected]
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.