Skip to content

Commit

Permalink
Preparation for Alfred 5
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorgalvao committed Jun 17, 2022
1 parent b1d5214 commit e590b15
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 87 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ List File Stream contents from Google Drive

## About

<!-- BEGIN ABOUT -->

An interim Workflow to bridge the gap until (if) Google Drive fixes the situation of files not being indexable by Spotlight (and thus Alfred).

Call `gd` and type to filter the contents of your Google Drive. `gdf` limits the search to folders.

![](https://user-images.githubusercontent.com/1699443/167266488-61a6f874-4f6c-41fb-a2f4-2c359ed429a0.png)
![Alfred search for gd](Workflow/images/about/gd.png)

![](https://user-images.githubusercontent.com/1699443/167266492-26ab7d8c-536c-4c0a-ab3f-4639f3d24d54.png)
![Alfred search for gd fran](Workflow/images/about/gdfran.png)

↵ opens the path; ⌥↵ reveals it in the Finder; ⇧↵ searches for it on Google Drive’s website.

Expand All @@ -24,7 +22,7 @@ To rebuild the cache on demand, run `:gdrebuildcache`.

The File Actions make it straightforward to copy and move files to a Google Drive folder.

![](https://user-images.githubusercontent.com/1699443/167266470-cca9430b-4255-46b8-a772-d4253e5a01f2.png)
![File Actions for Google Drive copy and mode](Workflow/images/about/fileaction.png)

The Workflow Environment Variables have defaults which will work for most. You only have to mess with them if you have an atypical setup.

Expand All @@ -35,6 +33,4 @@ The Workflow Environment Variables have defaults which will work for most. You o

`!gddiagnostic` inspects the current Workflow configuration. It is to be run when asking for help.

<!-- END ABOUT -->

<a href='https://github.com/alfredapp/google-drive-workflow/releases/latest/download/Google.Drive.alfredworkflow'>⤓ Download Workflow</a>
14 changes: 8 additions & 6 deletions Workflow/finder_copy
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on run argv
error "At least two arguments are required: a source and a target"
end if

set pathList to {}
set targetDir to (POSIX file (item -1 of argv) as alias)
set sourcePaths to {}
set targetDir to (POSIX file (last item of argv) as alias)

repeat with itemNumber from 1 to (length of argv) - 1
set pathString to item itemNumber of argv
copy ((POSIX file pathString) as alias) to the end of the pathList
repeat with itemNumber from 1 to (count of argv) - 1
try
set pathString to item itemNumber of argv
copy (POSIX file pathString as alias) to the end of sourcePaths
end try
end repeat

tell application "Finder" to duplicate pathList to folder targetDir
tell application "Finder" to duplicate sourcePaths to folder targetDir
end
14 changes: 8 additions & 6 deletions Workflow/finder_move
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on run argv
error "At least two arguments are required: a source and a target"
end if

set pathList to {}
set targetDir to (POSIX file (item -1 of argv) as alias)
set sourcePaths to {}
set targetDir to (POSIX file (last item of argv) as alias)

repeat with itemNumber from 1 to (length of argv) - 1
set pathString to item itemNumber of argv
copy ((POSIX file pathString) as alias) to the end of the pathList
repeat with itemNumber from 1 to (count of argv) - 1
try
set pathString to item itemNumber of argv
copy (POSIX file pathString as alias) to the end of sourcePaths
end try
end repeat

tell application "Finder" to move pathList to folder targetDir
tell application "Finder" to move sourcePaths to folder targetDir
end
Binary file added Workflow/images/about/fileaction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Workflow/images/about/gd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Workflow/images/about/gdfran.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e590b15

Please sign in to comment.