gdrive is a command line utility for interacting with Google Drive.
[More...]
[CMD] gDrive - interacting with Google Drive
Re: [CMD] gDrive - interacting with Google Drive
Correct me if i'm wrong, but isn't this just advertising?
Re: [CMD] gDrive - interacting with Google Drive
Have posted recommendations exactly that way for years at this forum (its predecessor, search for it).
Even using the same format - without a problem.
So I guess, no.
Greetz,
BoBo
Even using the same format - without a problem.
So I guess, no.
Greetz,
BoBo
Re: [CMD] gDrive - interacting with Google Drive
Very nice!
This could be used to create a file browser in AutoHotkey... For example, the code below to get the root directory contents:
This could be used to create a file browser in AutoHotkey... For example, the code below to get the root directory contents:
Code: Select all
#SingleInstance, Force
GuiCreate() {
Global ; Assume-global mode
Static Init := GuiCreate() ; Call function
Gui, +LastFound -Resize +HWNDhGdrive
Gui, Margin, 10, 10
Gui, Add, ListView, xs y+10 w800 r10, Id|Name|Type|Size|Created
Gui, Show, AutoSize, Example
Populate("'root' in parents and trashed = false")
}
GdQuery(Query) {
File := A_Temp "\GdriveQueryTemp.txt"
If (FileExist(File)) {
FileDelete, % File
}
RunWait, %ComSpec% /c gdrive-windows-386 list --max 0 --name-width 0 --absolute --query "%Query%" > %File%,, Hide
FileRead, QueryContents, % File
return QueryContents
}
Populate(Query) {
File := A_Temp "\GdriveQueryTemp.txt"
FileContents := GdQuery(Query)
IdPos := InStr(FileContents, "Id", 1, 1, 1)
NamePos := InStr(FileContents, "Name", 1, 1, 1)
TypePos := InStr(FileContents, "Type", 1, 1, 1)
SizePos := InStr(FileContents, "Size", 1, 1, 1)
CreatedPos := InStr(FileContents, "Created", 1, 1, 1)
LV_Delete()
Loop, Read, %File%
{
IfEqual, A_Index, 1, Continue
Id := RegExReplace(SubStr(A_LoopReadLine, IdPos, NamePos - IdPos), "^\s+|\s+$")
Name := RegExReplace(SubStr(A_LoopReadLine, NamePos, TypePos - NamePos), "^\s+|\s+$")
Type := RegExReplace(SubStr(A_LoopReadLine, TypePos, SizePos - TypePos), "^\s+|\s+$")
Size := RegExReplace(SubStr(A_LoopReadLine, SizePos, CreatedPos - SizePos), "^\s+|\s+$")
Created := RegExReplace(SubStr(A_LoopReadLine, CreatedPos), "^\s+|\s+$")
LV_Add("", Id, Name, Type, Size, Created)
}
Loop, % LV_GetCount("Col") {
LV_ModifyCol(A_Index, "AutoHdr")
}
}
Re: [CMD] gDrive - interacting with Google Drive
I really appreciate it if someone like you offers a sample code to show how AHK could be used that way.TheDewd wrote:Very nice!
This could be used to create a file browser in AutoHotkey... For example, the code below to get the root directory
Thanks a lot !!
Re: [CMD] gDrive - interacting with Google Drive
Is there a way to detect if Google Drive is syncing at the moment? and also when it is finished?
Re: [CMD] gDrive - interacting with Google Drive
I'd guess, yes. Check out the tools command lines switches/parameters (stdout/logging) for further details.fenchai wrote:Is there a way to detect if Google Drive is syncing at the moment? and also when it is finished?
Good luck
Return to “Other Utilities & Resources”
Who is online
Users browsing this forum: No registered users and 11 guests