Jump to content

Search the Community

Showing results for 'Google Drive File Stream'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Blogs

There are no results to display.

Categories

There are no results to display.

Calendars

There are no results to display.

Forums

  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Share your Workflows
    • Workflow Help & Questions
    • Workflow Advanced Tips & Tricks
    • Workflow Automation Tasks
  • Alfred Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting

Categories

  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Twitter


Location


Interests

  1. Setup Set your Google Drive’s location in the Workflow’s Configuration. Usage Search the contents of your Google Drive via the gd keyword. Filter for folders only with gdf. Fallback Searches are included. ↩: Open. ⌥↩: Reveal in Finder. ⇧↩: Search on Google Drive’s website. You’ll be asked to build the cache on the first run. A notification will show when it’s ready. The more files you have, the longer the wait. A macOS launchd agent will be loaded to do it daily. An immediate cache rebuild can be forced with ⌘⌥⌃↩. The Universal Actions make it straightforward to copy and move files to a Google Drive folder. To report a problem, run !gddiagnostic. ⤓ Install on the Alfred Gallery | Source
  2. I use Google Drive File Stream at work so sync files between my Mac and Google drive and I used to be able to [spacebar]file_name and anything with that name would come up. That's no longer the case and Alfred is only finding local files. At first I thought maybe the files on the Google Drive folder needed to be available offline but that didn't work either. And yes, I have added Google Drive to the search scope. Has anybody run into this problem? Did anything chance with either Alfred or Google Drive that's causing this issue?
  3. So here's the objective. I want to be able to open the "Drive File Stream Sharing Dialog" with Alfred using a file action so that when I select a file in Alfred that's also in my Drive, it will open the sharing dialog. I tried to see if it was an app embedded inside the Drive File Stream app container, but it's not. Seems to be a Finder extension of some kind. Any suggestions on how to proceed?
  4. Hi there, I posted a report that Spotlight & Alfred were not indexing the volume used in the new Google Drive File Stream volume, which was since closed. As recommended I got in touch with Google Suite people who had this to say "Unfortunately currently the File stream does't fully support Spotlight. The files for File stream are not stored in a separate File Stream cache which can't be indexed by Spotlight. There are some reports that if you reinstall the File stream it will work for a while but this is not an officially supported feature yet. There is an existing feature idea from the Cloud connect portal. You can vote for it as well and I hope that more options are added in future updates https://www.cloudconnect.goog/ideas/11068. I was checking for that as well but currently there are no reported workarounds besides reinstalling the app which is reported to work in some cases. I could't see any settings you can change to make this work" So that's the status as far as Google are concerned. The only workaround that would technically work would be to downgrade back down to the old Google Drive, though you lose the features of GDFS and it also has no support for Team Drives. Another workaround is to use this Google Drive workflow, but it is slower and only lets you go to files and not folders. I may actually downgrade to the old Google Drive app; I really miss the lightning fast ability to use Google Drive through Alfred. I'm also going to try to see what the status from the Apple Support side.
  5. This workflow searches Google Drive via the Google Drive File Stream app. Currently, Spotlight is the main method for searching but is unreliable. (It would be great to get some feedback on why this is.) As a backup, the user has the option to use a file index created by an included Ruby script to search - this is more reliable but also much slower. Feedback is welcome! http://www.packal.org/workflow/google-drive-search
  6. I tried everything and there is no way to make Google Drive — List File Stream contents from Google Drive operational. I Don't know what i'm doing wrong... a) I have a mac with Big Sur b) I installed Alfred 4 and updated c) I installed workflow Google Drive 2021.3 d) I did all steps in "about workflow": Call `gd` and type to list and filter the contents of your Google Drive. Before your first use, you will have to either run `:gdrebuildcache` or `:gdlaunchd`. The former builds a cache of your files on demand; the latter uses a macOS launchd agent to rebuild it every day (run `:gdlaunchd` again to uninstall it). e) google_drive_path has path value: /Volumes/GoogleDrive/ f) i have two Google Drives accounts
  7. Hi! I'm completely new here, please sorry for my ignorance and thanks in advance for helping I'm using Google Drive for desktop in my Mac, and some time ago it started to block files indexing (what is a heavy nightmare). So I started looking for alternatives, and I found Alfred. As I see, there is a Google Drive workflow that allows to find files locally in my virtual Drive folder, which is great. But my question is: Does Alfred do the same job as Spotlight when I'm working inside regular programs like Photoshop, Illustrator, etc? I mean: If I'm working on illustrator, and I have to "save as" a file in the "My Client" directory, can I search for "My client" inside illustrator when I'm saving my work? Or is it just to use in the finder? This is what really save my day, not to go folder by folder looking for the right place to save my work. This is clearly an example. There is an Image trying to explain what I would need. It is a pity that Power Pack can't offer a trial period, I would love to try it and then buy it if that works... Thanks again! Jorge
  8. Ah - that is probably significant and relevant.It might be helpful to take a look at this workflow on the gallery: Google Drive (which List(s) File Stream contents from Google Drive). I suspect if you search for "Google drive” on the forums most threads will end with a reference to that workflow! (Sorry, in a rush at the moment so please excuse the fact I've not included more explanation: the forum search will probably give it.) Edited to overcome forum fomatting with deleted text. Stephen
  9. I am a new Alfred user (4.2.1[1187]). I am finding that indexing of files on Google Drive is inconsistent. For example when I was searching for "Acera Surgical..." Alfred did display it correctly: But when I search for "Vai and Sosulski..." the Google Drive entry didn't appear: Any advice? Alfred seems to be indexing Dropbox, OneDrive, my hard drive just fine.
  10. #!/usr/bin/ruby require 'socket' require 'net/http' require 'net/https' require 'uri' require 'json' require 'webrick' require 'shellwords' require 'fileutils' require 'logger' require 'tempfile' require 'open-uri' CLIENT_ID = 'xxxxxxx' CLIENT_SECRET = 'xxxxxxx' REDIRECT_URL = 'http://127.0.0.1:1337' RELEASES_URL = "https://api.github.com/repos/#{ENV['gh_repos'] || 'azai91/alfred-drive-workflow'}/releases" BUNDLE_ID = ENV['alfred_workflow_bundleid'] || 'com.drive.azai91' CACHE_DIR = ENV['alfred_workflow_cache'] || "/tmp/#{BUNDLE_ID}" WORKFLOW_NAME = ENV['alfred_workflow_name'] || 'Google Drive' VERSION = ENV['alfred_workflow_version'] || '1.0' EJECT_ICON_PATH = '/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/EjectMediaIcon.icns' SYNC_ICON_PATH = '/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Sync.icns' 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' }, } FileUtils.mkdir_p(CACHE_DIR) $log = Logger.new(STDERR.tty? || ENV['alfred_debug'] ? STDERR : "#{CACHE_DIR}/google-drive.log") $log.formatter = proc do |severity, datetime, progname, msg| "[#{datetime.strftime('%Y-%m-%d %H:%M:%S.%3N')}] [#{Process.pid}] %7s #{msg}\n" % "[#{severity}]" end def duration_in_words(from, to = Time.now) duration = (to - from).round.to_f case duration when 0...2 then 'just now' when 2...60 then '%.0f seconds ago' % duration when 60...90 then 'a minute ago' when 90...3570 then '%.0f minutes ago' % (duration/60) when 3570...5400 then 'an hour ago' when 5400...84600 then '%.0f hours ago' % (duration/(60*60)) when 84600...129600 then 'a day ago' when 129600...561600 then '%.0f days ago' % (duration/(24*60*60)) when 561600...1036800 then 'a week ago' when 1036800...2419200 then '%.0f weeks ago' % (duration/(7*24*60*60)) when 2419200...3952800 then 'a month ago' when 3952800...30304800 then '%.0f months ago' % (duration/(30.5*24*60*60)) when 30304800...47304000 then 'a year ago' else '%.0f years ago' % (duration/(365*24*60*60)) end end module SemVer def SemVer.compare(lhs, rhs) less?(lhs, rhs) ? -1 : (less?(rhs, lhs) ? +1 : 0) end def SemVer.less?(lhs_str, rhs_str) array_less?(parse(lhs_str), parse(rhs_str), true) do |a, b| array_less?(a.split('.'), b.split('.'), false) do |lhs, rhs| lhs_is_i, rhs_is_i = lhs =~ /^\d+$/, rhs =~ /^\d+$/ lhs_is_i && (!rhs_is_i || lhs.to_i < rhs.to_i) || !rhs_is_i && lhs < rhs end end end def SemVer.parse(str) if str =~ /\Av?(\d+(?:\.\d+){,2})(?:-(.+?))?(?:\+(.+))?\Z/ [ $1, $2 ].reject { |e| e.nil? } else $log.error("Not a valid version string: ‘#{str}’") [ '0' ] end end def SemVer.array_less?(lhs, rhs, longer_is_less) for i in 0...([lhs.size, rhs.size].min) return true if yield lhs[i], rhs[i] return false if yield rhs[i], lhs[i] end longer_is_less ? lhs.size > rhs.size : lhs.size < rhs.size end end class Keychain def self.add(password, account, service, comment = nil, label = nil) %x{ /usr/bin/security -q add-generic-password -j #{comment.to_s.shellescape} -l #{(label || service).shellescape} -s #{service.shellescape} -a #{account.shellescape} -w #{password.shellescape} -U } $log.error("Exit code #$? from /usr/bin/security while adding generic password for #{account}") if $?.exitstatus != 0 $?.exitstatus == 0 end def self.find(account, service) open("|/usr/bin/security 2>&1 find-generic-password -s #{service.shellescape} -a #{account.shellescape} -g") do |io| if io.read =~ /^password:\s+(?:0x(\h+)\s+)?"(.*)"$/ $1 ? $1.scan(/\h\h/).map { |ch| ch.hex }.pack("C*") : $2 end end end def self.comment(account, service) open("|/usr/bin/security 2>&1 -v find-generic-password -s #{service.shellescape} -a #{account.shellescape}") do |io| if io.read =~ /^attributes:\n(^\s+.*\n)+/m if $1 =~ /^\s+"icmt"<blob>=(?:0x(\h+)\s+)?"(.*)"$/ $1 ? $1.scan(/\h\h/).map { |ch| ch.hex }.pack('C*') : $2 end end end end def self.delete(account, service) %x{ /usr/bin/security 2>&1 -q delete-generic-password -s #{service.shellescape} -a #{account.shellescape} } $log.debug("Deleted generic password for #{account}") $?.exitstatus == 0 end end class Auth def initialize(host, port) @server = TCPServer.new(host, port) end def accept_token $log.debug("Starting HTTP server") loop do socket = @server.accept request = '' until (str = socket.gets).chomp.empty? request << str end util = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP) util.parse(StringIO.new(request)) $log.debug("Received HTTP request: #{util.request_line.chomp}") token = nil if util.request_method == 'GET' && util.path == '/' && util.query.has_key?('code') token = Auth.get_token({ 'grant_type' => 'authorization_code', 'code' => util.query['code'], 'redirect_uri' => REDIRECT_URL, }) end response = token.nil? ? "Something went wrong.\n" : "Successfully connected to Google Drive!\n" socket.print "HTTP/1.1 200 OK\r\n" socket.print "Content-Type: text/plain\r\n" socket.print "Content-Length: #{response.bytesize}\r\n" socket.print "Connection: close\r\n" socket.print "\r\n" socket.print response socket.close # Only serve a single request for ‘GET /’ break if util.request_method == 'GET' && util.path == '/' end $log.debug("Stopping HTTP server") end @service_name = "#{BUNDLE_ID}" def self.get_token(options) token = nil token_url = 'https://www.googleapis.com/oauth2/v3/token' response = Net::HTTP.post_form(URI.parse(token_url), options.merge({ 'client_id' => CLIENT_ID, 'client_secret' => CLIENT_SECRET, })) if response.code.to_i == 200 json = JSON.parse(response.body) if json.has_key?('refresh_token') Keychain.add(json['refresh_token'], 'drive_refresh_token', @service_name) $log.info("Refresh token added to keychain") end if json.has_key?('access_token') $log.warn("Access token has no expiration time") unless json.has_key?('expires_in') Keychain.add(json['access_token'], 'drive_access_token', @service_name, json.has_key?('expires_in') ? "Expires: #{(Time.now + json['expires_in'].to_i).iso8601}" : nil, @service_name) token = json['access_token'] $log.info("Access token added to keychain, expires in #{json['expires_in']} seconds") else $log.error("Access token missing from server response: #{json}") end else $log.error("Server returned #{response.code} when requesting token: #{JSON.parse(response.body)['error_description']}") end token end def self.token if Keychain.comment('drive_access_token', @service_name) =~ /^Expires: (.*)/ return Keychain.find('drive_access_token', @service_name) if (Time.parse($1) - Time.now) > 10 $log.info("Access token expired #{duration_in_words(Time.parse($1))}") end if refresh_token = Keychain.find('drive_refresh_token', @service_name) token = get_token({ 'grant_type' => 'refresh_token', 'refresh_token' => refresh_token, }) return token unless token.nil? end uri = URI.parse(REDIRECT_URL) thread = nil begin server = Auth.new(uri.host, uri.port) thread = Thread.new { server.accept_token } rescue Errno::EADDRINUSE => e $log.error("Already waiting for authentication: #{e}") end $log.info('Requesting user authentication via browser') auth_url = 'https://accounts.google.com/o/oauth2/auth?' + URI.encode_www_form({ 'client_id' => CLIENT_ID, 'redirect_uri' => REDIRECT_URL, 'scope' => 'https://www.googleapis.com/auth/drive', 'response_type' => 'code', 'access_type' => 'offline', 'approval_prompt' => 'force' }) %x{ /usr/bin/open ${open_args} #{auth_url.shellescape} } thread.join unless thread.nil? if token = Keychain.find('drive_access_token', @service_name) return token end abort 'No access token' end def self.revoke if token = Keychain.find('drive_refresh_token', @service_name) revoke_url = 'https://accounts.google.com/o/oauth2/revoke' response = Net::HTTP.post_form(URI.parse(revoke_url), { 'token' => token }) if response.code.to_i == 200 Keychain.delete('drive_access_token', @service_name) Keychain.delete('drive_refresh_token', @service_name) $log.info("Revoked access token") return true else $log.error("Server returned #{response.code} when revoking token: #{JSON.parse(response.body)['error_description']}") end else $log.warn("Refresh token missing while trying to revoke access") end false end end class GoogleDrive def self.get_items(token) uri = URI.parse('https://www.googleapis.com/drive/v2/files') mime_types = MIME_TYPE_ICONS.keys << 'application/vnd.google-apps.folder' query = "trashed=false and (#{mime_types.map { |type| "mimeType='#{type}'" }.join(' or ')})" if custom = ENV['custom_query'] query = "(#{query}) and (#{custom})" end parms = { 'q' => query, 'fields' => 'nextPageToken,items(id,title,alternateLink,mimeType,parents(id,isRoot),modifiedDate,lastModifyingUserName)', 'maxResults' => 1000, } http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true items = [] loop do uri.query = URI.encode_www_form(parms) request = Net::HTTP::Get.new(uri.request_uri) request.add_field('authorization', "Bearer #{token}") response = http.request(request) if response.code.to_i == 200 body = JSON.parse(response.body) $log.info("Got #{body['items'].size} items from Google Drive") items += body['items'] next if parms['pageToken'] = body['nextPageToken'] else $log.error("Server returned #{response.code} when fetching items from Google Drive: #{JSON.parse(response.body)['error_description']}") end break end items end end class Cache @cache_file = "#{CACHE_DIR}/drive-items.json" @cache_max_age = 10*60 # 10 minutes class << self attr_accessor :needs_update end def self.get_items items = { 'created' => DateTime.now, 'items' => GoogleDrive.get_items(Auth.token), } io = Tempfile.new('items', CACHE_DIR) io << JSON.generate(items) io.close FileUtils.mv(io.path, @cache_file) items end def self.items items = open(@cache_file) { |io| JSON.parse(io.read) } rescue nil if items.nil? items = get_items else $log.debug("Loaded #{items['items'].size} items from cache (created #{duration_in_words(Time.parse(items['created']))})") unless items.nil? @needs_update = (Time.now - Time.parse(items['created'])) > @cache_max_age end items['items'] end def self.delete File.unlink(@cache_file) rescue nil end end class Releases @cache_file = "#{CACHE_DIR}/github-releases.json" @cache_max_age = 12*60*60 # 12 hours def self.online res = open(RELEASES_URL) { |io| JSON.parse(io.read) } $log.info("Got #{res.size} releases from #{RELEASES_URL}") res.each do |release| release['assets'] = release['assets'].select do |asset| asset['name'] =~ /\.alfredworkflow$/ && asset['content_type'] == 'application/octet-stream' && asset['browser_download_url'] end end res.reject do |release| release['draft'] || release['assets'].empty? end end def self.cached releases = open(@cache_file, File::RDONLY) do |io| io.flock(File::LOCK_SH) JSON.parse(io.read) end rescue nil $log.debug("Loaded #{releases['releases'].size} releases from cache (created #{duration_in_words(Time.at(releases['created']))})") unless releases.nil? releases ? releases['releases'] : [ ] end def self.refresh_cache open(@cache_file, File::RDWR|File::CREAT) do |io| io.flock(File::LOCK_SH) releases = JSON.parse(io.read) rescue nil if releases.nil? || Time.now.to_f - releases['created'] > @cache_max_age releases = { 'created' => Time.now.to_f, 'releases' => Releases.online } io.flock(File::LOCK_EX) io.seek(0) io.truncate(0) io.write(JSON.generate(releases)) end end self end def self.latest(include_prereleases = false) releases = Releases.cached releases = releases.reject { |release| release['prerelease'] } unless include_prereleases releases.max { |lhs, rhs| SemVer.compare(lhs['tag_name'], rhs['tag_name']) } end end # ======== # = Main = # ======== start = Time.now $log.debug("#$0 #{ARGV}") begin if ARGV[0] == '--revoke' if Auth.revoke STDOUT << "Signed out of Google Drive\n" else STDERR << "Failed to sign out\n" end Cache.delete elsif ARGV[0] == '--create' type = ARGV[1] name = (ARGV[2] == '--name' ? ARGV[3] : nil).to_s.strip name = name.empty? ? 'Untitled' : name token = Auth.token uri = URI.parse('https://www.googleapis.com/drive/v3/files?fields=webViewLink') http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Post.new(uri.request_uri) request['authorization'] = "Bearer #{token}" request["content-type"] = 'application/json' request.body = JSON.generate({ :mimeType => type, :name => name, }) response = http.request(request) if response.code.to_i == 200 body = JSON.parse(response.body) if body.has_key?('webViewLink') %x{ /usr/bin/open ${open_args} #{body['webViewLink'].shellescape} } Cache.needs_update = true else $log.error("No webViewLink in response: #{response.body}") STDERR << "Link to new document missing from server response\n" end else $log.error("Server returned #{response.code} when creating document with type #{type}: #{JSON.parse(response.body)['error_description']}") STDERR << "Failed to create document.\nServer responded with status #{response.code}\n" end elsif ARGV[0] == '--filter' filter = ARGV[1].to_s.strip name = filter =~ /\S+\s(.+)/ ? $1 : nil res = [ [ 'Document', 'doc', '6EA9C89F-E56A-4DD5-AF21-870869D441E6' ], [ 'Spreadsheet', 'sheet', 'ACAA585E-C8CE-4D64-AE64-2AD41F6CA9F5' ], [ 'Presentation', 'slide', 'EB4B6437-13DB-4E65-9F7D-5BE060E37649' ], [ 'Form', 'form', '3D2966E3-0639-411D-8334-E1926B8626CF' ] ].map do |arr| { :title => "New #{arr[0]}", :subtitle => "Name: ‘#{name || 'Untitled'}’", :match => "New #{arr[0]} #{name}", :icon => { :path => "icons/#{arr[1]}.png" }, :variables => { :action => '--create', :name => name }, :arg => "application/vnd.google-apps.#{arr[0].downcase}", :uid => arr[2], } end res << { :title => 'Sign out of Google Drive', :icon => { :path => EJECT_ICON_PATH }, :variables => { :action => '--revoke' }, :arg => 'revoke', :uid => '87B64A2A-F6CE-461C-9A2F-303719D20EFE', } if latest = Releases.latest $log.debug("Latest online version is #{latest['tag_name']}, we are running #{VERSION}") if SemVer.less?(VERSION, latest['tag_name']) if asset = latest['assets'].first res << { :title => "Update to #{WORKFLOW_NAME} version #{latest['tag_name'].sub(/^v?/, '')}", :subtitle => "You are using version #{VERSION}", :icon => { :path => SYNC_ICON_PATH }, :uid => '1EBA5153-782F-485A-BC5A-10D2E5712DAC', :arg => asset['browser_download_url'], :variables => { :action => '--update-to' }, } end end end filter_regex = /#{filter.split(//).map { |ch| Regexp.escape(ch) }.join('.*?')}/i res = res.select { |item| (item[:match] || item[:title]) =~ filter_regex } if items = Cache.items parents_by_id = { } folders = items.select { |item| item['mimeType'] == 'application/vnd.google-apps.folder' } folders.each { |item| parents_by_id[item['id']] = item } files = items.reject { |item| item['mimeType'] == 'application/vnd.google-apps.folder' } files = files.select { |item| item['title'] =~ filter_regex } files = files.sort { |lhs, rhs| rhs['modifiedDate'] <=> lhs['modifiedDate'] } res += files.map do |item| parents = [] parent = item['parents'].first while parent && parent.has_key?('isRoot') && parent['isRoot'] == false if parent = parents_by_id[parent['id']] parents << parent['title'] parent = parent['parents'].first end end parents = parents.reverse.join('/') modified = "Modified #{duration_in_words(Time.parse(item['modifiedDate']))} by #{item['lastModifyingUserName'] || 'anonymous'}" { :uid => item['id'], :title => item['title'], :subtitle => [ parents, modified ].reject { |e| e.to_s.empty? }.join(' • '), :icon => MIME_TYPE_ICONS[item['mimeType']], :arg => item['alternateLink'], :variables => { :action => '--open' }, } end end container = { :items => res } container[:rerun] = 0.8 if Cache.needs_update STDOUT << JSON.generate(container) elsif ARGV[0] == '--check-for-updates' if latest = Releases.refresh_cache.latest $log.debug("Latest online version is #{latest['tag_name']}, we are running #{VERSION}") if SemVer.less?(VERSION, latest['tag_name']) STDOUT << "Enter ‘d update’ to install #{WORKFLOW_NAME} version #{latest['tag_name'].sub(/^v?/, '')}\nYou are using version #{VERSION}\n" end end elsif ARGV[0] == '--update-to' url = ARGV[1] path = File.join(ENV['TMPDIR'] || '/tmp', File.basename(URI.parse(url).path)) $log.info("Downloading #{url} to #{path}") %x{ /usr/bin/curl -Lo #{path.shellescape} #{url.shellescape} } if $?.exitstatus == 0 $log.info("Installing update using ‘open’") %x{ /usr/bin/open #{path.shellescape} } else $log.error("Exit code #$? from /usr/bin/curl") end else $log.error("Unknown argument") end rescue Exception => e $log.fatal("Uncaught exception: #{e}") e.backtrace.each { |line| $log.fatal(line) } end $log.debug("Execution took #{(Time.now - start).round(3)} seconds") if Cache.needs_update Process.daemon begin open("#{CACHE_DIR}/lockfile", File::RDWR|File::CREAT) do |io| if io.flock(File::LOCK_EX|File::LOCK_NB) $log.debug("Start background cache update") Cache.get_items $log.debug("Finished background cache update") else $log.debug('Skip background cache update: Another process is already running') end end rescue Exception => e $log.fatal("Uncaught exception: #{e}") e.backtrace.each { |line| $log.fatal(line) } end end
  11. Hello, hoping I can get some advice. I recently moved my Alfred (4.6.2) sync folder from Dropbox to a Google Drive folder synced using File Stream. I've told the Google Drive app to keep the sync folder locally available. Since I've done this, I've had two problems: 1. I can't delete workflows. I get an error in red at the top of Alfred's preference window which says: 2. Since I've moved the sync folder, I can no longer install a workflow. I've been trying to install this one but it never installs. There is no error message. The import prompt does appear, but the workflow simply never appears in the list of workflows, and can't be invoked. Any advice? Is it possible to use Google Drive with the File Stream option to backup Alfred's preferences without problems? I prefer not to be running Google Drive and Dropbox (but I must use Google Drive). If relevant, I'm on MacOS 12.1. Thanks!
  12. So Google Drive is going away, and being replaced eventually with Google Drive File Stream. So I've installed the latter to give a test run. Google Drive File Stream acts like an attached drive, and now shows up on the list of media that Alfred can eject. I'm wondering if there is any way to make the drive created by Google Drive File Stream exempt from the eject feature, especially the "eject all". I like the ability to "eject all", but I don't want that to include Google Drive File Stream.
  13. Hi everyone, I was wondering if anyone else is experiencing issues with Google Drive File stream. I'm not a pro at all but I think they pushed an update yesterday (08/04) and now I can't browse my files. Anybody out here now any good tricks to fix this?
  14. Thanks! Glad it's working for you. To open files in Google Drive: Google Doc extensions (.gdoc, .gsheet, etc.) should open in Google Drive automatically, as long as they're set to open with the Google Drive File Stream app (which they should be by default - it may also be called just "Google Drive" depending on the version you have). Other files can be set to open in Google Drive by setting each file type to automatically open in "openInGoogleDrive.app", which is included in my Alfred workflow. In Alfred, right-click the workflow and then pick "Open in Finder" to see its location. Then for each file type that you want to open in Google Drive, set openInGoogleDrive.app as the default (detailed instructions at https://www.imore.com/how-set-mac-app-default-when-opening-file#file). Note that this is basically just a quick way of right-clicking the file and selecting "Open with Google Drive" - it's not the fastest or most elegant solution, but it's the only one I see available right now for non-Google file types. Also FYI, at least on my end, Spotlight indexing is working very reliably after recent updates to Google Drive File Stream, so I don't even really need the Ruby backup anymore.
  15. Hello. I have just installed Google Drive File Stream and a new Volume was added that contains all the files. I have added the volume in Alfred Search Scope, but I cannot search for the files in Alfred. In the Drive File Stream volume I have some files that are available offline and som that are online only. I saw in the forum another person who had the same issue, and the recommendation was to add the new volume to the search scope in Alfred. I have done this, but it is still not working. Any help is appreciated. BR, -Niclas Alfred 3.5.1 Pre-release MacOS 10.13
  16. Good that you mention this. Backup and Sync from Google is the old Version for Google Drive (private). If you are a Google Workspace Customer (for business purpose) you can't use "Backup and Sync from Google" instead you must use "Google File Stream". Because this is very confusing, Google did a cool step: They simplified both apps and bring it together. So "Backup and Sync from Google" and "Google File Stream" are now "Google Drive for Desktop". In this help article it will be explained: https://support.google.com/googleone/answer/10309431 Look at the FAQ section they will explain it there. @Michal Bryxí you should definitely stick to "Backup and Sync from Google" otherwise you can not use Spotlight or Alfred search. I'm really jealous of you, because you can use it still.
  17. I'm running in the same error @Michal Bryxí reported here. I did a detailed posting in this thread: After posting there I found this thread which is maybe the better fit. As I understand correctly, Alfred is using the spotlight search index correct? For me, also, spotlight is not finding the files in my Google Drive Folder. I switched from Google File Stream to Google Drive for Desktop. Here is the news from Google regarding this update: Upcoming changes to Google Drive sync clients (support.google.com) @Michal Bryxí could you explain how you manage it that spotlight is showing you the results? Did you somehow install the old Google File Stream App again? And how could I add a folder to spotlight to search for files there, like I can do it in Alfred? With a "Finder alias" or a "Symlink" ? Thanks a lot for your help in advance!
  18. Thanks for this workflow, @vitor! I had been clinging on to my Drive Mirror folder since it was still indexed by Spotlight, but I can now finally consider return to the promised land of File Streaming. For others in a similar situation, it seems the default (or default back then) path for the Google Drive Mirror folder was in /Users/[youruser]/Google Drive (with a space). Although I don't know if changing from Mirror to Stream, which I suspect will change the path to /Volumes/GoogleDrive (since it's the workflow default), would also move or discard the Mirror directory completely.
  19. I use the Google Drive workflow (List File Stream contents from Google Drive) and it works great. There is an environment variable to identify the Google Drive path. I have two Macs, one for work and one for personal, that I use Alfred on and I sync the preferences between them. Unfortunately, in the sync process, the environment variables get overridden from my other computer and therefore the workflow fails until I change the path to the correct path which then causes the workflow on the other Mac to fail. Is it possible to eliminate the syncing for this workflow? Do I need to turn off preference syncing and turn it back on when I make other preference changes? Any thoughts or suggestions would be appreciated.
  20. Hi @vitor, thanks for this workflow -- works great! 🙏 Is there a workaround to open folders directly in Google Drive (not in Finder)? I understand this is a limitation of the File Stream, but there's an "Open with Google Drive" option when we right-click the folders in Finder. Any way to utilize it for this desired result? Thanks! P.S. As an alternative solution, would it be possible to use the "Search Google Drive for '{query}'" web search shortcut in Alfred by passing the Google Drive folder name, as opposed to the folder path? It can't open the folder, but it'll make it easier to reach the desired folder with one extra click.
  21. Hello Vero, Google Spreadsheets are "gdoc" files and they are just links to a drive.google.com URL inside of chrome. They don't act as the actual file, and thus one can not search inside of them. A solution for this is to export the document as a DOCX (or XLS), and then upload it again and keeping it a DOCX (google now supports this, before they automatically converted the file to google drive's format). After that, a .docx file would be synced on your computer, and this file can be edited both in Google Drive via browser and locally through word, and it syncs very well. I also post this in case it works for anyone having issues with GDFS and it's search: The fact that GFS "mounts" is very inconvenient. Alfred can indeed index files by name (as can spotlight) but I am having issues with searching for content inside the files, for instance, phrases inside a PDF. And this is both from spotlight and from alfred (although alfred uses spotlight's index, so it's the same). This was a deal breaker for me, the ability to search within the files I feel it's extremely important. The only solution I found was not to use Google Drive File Stream and switch to Google's Backup and Sync. The main difference (that I can see) is that it doesn't offer real time view on Office's products when someone is editing the file on drive.google.com. This isn't a deal breaker for me, I use it mostly as a personal tool. As a note: I don't know how Backup and Sync manages having multiple drives, I don't know if it supports it (I don't use them). Other than that, Backup and Sync actually creates a folder on your Mac, with all content stored locally (as Dropbox or iCloud do). This might help anyone, so here's what I did. In case anyone wants more info, here's a comparison between both tools: https://support.google.com/drive/answer/7638428?hl=en Cheers!
  22. I have the same problem, one Google drive is indexed in both Spotlight and Alfred, while the other isn’t; both are loaded via Google Stream. Starting Diagnostics... File: '2021 Aug CCC Fri - Colleen.gslides' Path: '/Volumes/GoogleDrive/My Drive/My Placewise Drive/My Placewise/Docs/Leadership/IDEO/Cultivating Creative Collaboration/Lesson 1 – ' ----------------------------------------------------------- Check file cache database... ✅ File cache integrity is ok ----------------------------------------------------------- Check if file is readable... ✅ Alfred has permissions to read this file. ----------------------------------------------------------- Check if volume '/Volumes/GoogleDrive/' is indexed by macOS... ⚠️ Indexing may not be enabled on this drive /System/Volumes/Data/Volumes/GoogleDrive: Indexing disabled. ----------------------------------------------------------- Check direct file metadata... ✅ Direct metadata available Display Name: 2021 Aug CCC Fri - Colleen.gslides Other Names: Content Type: com.google.gslides Last Used: 2021-09-03 21:26:17 +0000 ----------------------------------------------------------- Check mdls file metadata... ❌ macOS metadata missing essential items kMDItemFSContentChangeDate = 2021-09-03 21:26:17 +0000 kMDItemFSCreationDate = 1970-01-01 00:00:00 +0000 kMDItemFSCreatorCode = "" kMDItemFSFinderFlags = 0 kMDItemFSHasCustomIcon = 0 kMDItemFSInvisible = 0 kMDItemFSIsExtensionHidden = 0 kMDItemFSIsStationery = 0 kMDItemFSLabel = 0 kMDItemFSName = "2021 Aug CCC Fri - Colleen.gslides" kMDItemFSNodeCount = 151 kMDItemFSOwnerGroupID = 20 kMDItemFSOwnerUserID = 501 kMDItemFSSize = 151 kMDItemFSTypeCode = "" ----------------------------------------------------------- ❌ Troubleshooting failed
  23. From the documentation: In theory it should work because you’re telling Google Drive to keep that directory locally. In practice, Google Drive File Stream is known to be problematic on macOS.
  24. Hi @katzja, welcome to the forum. Generally, you probably wouldn't want to add your Google Drive to Alfred's default scope, but if Spotlight finds a file, Alfred should be able to, too. The problem is a well-known, long-standing one. GDFS is a virtual filesystem, so it has to tell macOS what’s on the filesystem in order for Spotlight, Alfred etc. to be able to search it. GDFS is really bad at doing this. If you only have one Google Drive—and enough disk space—the old Google Drive app that actually synced files to your disk drive works perfectly with Spotlight and Alfred because macOS takes care of the indexing itself. I'm going to lock this thread because the problem is with GDFS and there's nothing Alfred can realistically do to work around it. There are a bunch of existing threads about GDFS, which would be the best places to post your experiences and read other people's. https://www.alfredforum.com/search/?q=google drive file stream&quick=1&type=forums_topic
  25. It does for some people, but not for others. Indexing has always been temperamental. The primary issue with Google Drive File Stream is that it serves your drive from a random port. As a result, macOS thinks it's a different drive every time you restart GDFS, meaning you have to completely re-index it.
×
×
  • Create New...