Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find .pdf or .psd #13

Open
littke opened this issue Apr 22, 2016 · 6 comments
Open

Can't find .pdf or .psd #13

littke opened this issue Apr 22, 2016 · 6 comments

Comments

@littke
Copy link

littke commented Apr 22, 2016

Thanks for a great plugin! Just what I needed.

The workflow seems not to find any files that are not Google Docs, Spreadsheets or maybe Presentations. I've got tons of files in my Drive that are of other formats, and I'd love to find those as well.

@azai91
Copy link
Owner

azai91 commented Apr 23, 2016

added a patch that allows for pdfs. working on feature that will allow you to customize different types of files. which type would you say you need after docs, sheets, slides, forms, and pdfs?

@littke
Copy link
Author

littke commented Apr 25, 2016

Hmm. May I ask the rationale behind only searching certain filetypes? I'd assume it found anything.

Also not sure what you mean by "forms".

Thanks.

@azai91
Copy link
Owner

azai91 commented Apr 25, 2016

Google forms (https://www.google.com/forms/about/). Google by default returns all file types - including folders and other meta files - which made the results most of the time incomprehensible. I am going to add a setting where you can filter the file types to allow for more customizability.

@littke
Copy link
Author

littke commented Apr 25, 2016

Dope.

Yes, I've been trying to search for folders too. Nice.

@sorbits
Copy link
Collaborator

sorbits commented Aug 28, 2017

For anyone needing support for more file types, at the top of google-drive.rb you will find this (associative) array:

MIME_TYPE_ICONS = {
  'application/vnd.google-apps.document'     => { :path => 'icons/doc.png'   },
  'application/vnd.google-apps.spreadsheet'  => { :path => 'icons/sheet.png' },
  'application/vnd.google-apps.presentation' => { :path => 'icons/slide.png' },
  'application/vnd.google-apps.form'         => { :path => 'icons/form.png'  },
  'application/pdf'                          => { :path => 'icons/dummy.pdf', :type => 'fileicon' },
}

You can add new lines to this array to get more file types included.

Unfortunately for a proper icon, Alfred requires either an image file or a local file with the file extension that indicate what (system) icon should be used. The latter is what is done for pdf files.

After making changes to the array, it may take up to 10 minutes before your new file type shows up in Alfred because of caching.

Though you can safely delete the cache by running this in a terminal:

rm ~/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow\ Data/com.drive.azai91/drive-items.json

Pull requests for more file types are welcomed, it is primarily because of the icon mapping that I have not made it show all file types, as we either need to manually map all known file types to icons, or possibly dynamically create dummy icons in the cache folder for unknown file types.

@franzau
Copy link

franzau commented Mar 2, 2018

I have also
md
docx
pptx
xlsx

It would be great to be able to search for them too.
Thanks!
Francesco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants