mergGoogle is an iOS and OS X external that currently implements the google spreadsheets api
function mergGoogleAuth pScope,pClientID,pSecret,pKeychainItemName
Look in the keychain for valid authentication data and if not found present an authentication dialog.
Parameters:
- pScope - The scope of the authentication as urls separated by space. For spreadsheets use "https://spreadsheets.google.com/feeds"
- pClientID - Your client ID obtained from https://code.google.com/apis/console
- pSecret - Your client secret obtained from https://code.google.com/apis/console
- pKeychainItemName - A string used to save the authentication data to.
Returns An id for the saved authentication data or an error string
command mergGoogleSpreadsheetsInitialize pAuth
Initialise the spreadsheet client with the authentication data
Parameters:
- pAuth - An id as returned by mergGoogleAuth
Spreadsheets
command mergGoogleLoadSpreadsheets
Load the user's spreadsheets. The mergGoogleSpreadsheetsLoaded and mergGoogleLoadSpreadsheetsError message is sent to the control that called mergGoogleSpreadsheetsInitialize
message mergGoogleSpreadsheetsLoaded pSpreadsheets
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pSpreadsheets - A tab delimited list of spreadsheets with item 1 being the spreadsheet identifier and item 2 being the title of the spreasheet.
message mergGoogleLoadSpreadsheetsError pError
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pError - An error message describing the reason for the failure to load the spreadsheets.
Worksheets
command mergGoogleLoadWorksheets [pSpreadsheet]
Load a specific worksheet from a given spreadsheet. The mergGoogleWorksheetsLoaded and mergGoogleLoadWorksheetsError message is sent to the control that called mergGoogleSpreadsheetsInitialize
Parameters:
- pSpreadsheet - (optional with "" default) A spreadsheet identifier as returned by the mergGoogleSpreadsheetsLoaded message. If empty or no parameter passed then the spreadsheet will be the currently loaded spreadsheet.
message mergGoogleWorksheetsLoaded pSpreadsheet,pWorksheets
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pSpreadsheet - The identifier of the spreadsheet that the worksheets were loaded from.
- pWorksheets - A tab delimited list of worksheets with item 1 being the worksheet identifier, item 2 being the title of the worksheet, item 3 the row count and item 4 being the column count.
message mergGoogleLoadWorksheetsError pError
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pError - An error message describing the reason for the failure to load the worksheets.
command mergGoogleCreateWorksheet pTitle,[pSpreadsheet],[pColums],[pRows]
Create a new worksheet in a given spreadsheet. The mergGoogleWorksheetCreated and mergGoogleCreateWorksheetError message is sent to the control that called mergGoogleSpreadsheetsInitialize
Parameters:
- pTitle - A title for the new worksheet
- pSpreadsheet - (optional with "" default) A spreadsheet identifier as returned by the mergGoogleSpreadsheetsLoaded message. If empty or no parameter passed then the spreadsheet will be the currently loaded spreadsheet.
- pColums - (optional with -1 default) The number of columns in the new worksheet. The default value of -1 will leave this value unset.
- pRows - (optional with -1 default) The number of rows in the new worksheet. The default value of -1 will leave this value unset.
message mergGoogleWorksheetCreated pWorksheet
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pWorksheet - The identifier of the newly created worksheet
message mergGoogleCreateWorksheetError pError
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pError - An error message describing the reason for the failure to create the worksheet.
command mergGoogleUpdateWorksheet pTitle,[pWorksheet],[pColums],[pRows]
Update a given worksheet. The mergGoogleWorksheetCreated and mergGoogleCreateWorksheetError message is sent to the control that called mergGoogleSpreadsheetsInitialize
Parameters:
- pTitle - A title for the worksheet
- pWorksheet - (optional with "" default) A spreadsheet identifier as returned by the mergGoogleWorksheetsLoaded message. If empty or no parameter passed then the worksheet will be the currently loaded worksheet.
- pColums - (optional with -1 default) The number of columns in the worksheet. The default value of -1 will leave this value unset.
- pRows - (optional with -1 default) The number of rows in the worksheet. The default value of -1 will leave this value unset.
message mergGoogleWorksheetUpdated pWorksheet
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pWorksheet - The identifier of the newly created worksheet
message mergGoogleUpdateWorksheetError pError
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pError - An error message describing the reason for the failure to create the worksheet.
command mergGoogleDeleteWorksheet [pWorksheet]
Delete a worksheet from a given spreadsheet
Parameters:
- pWorksheet - (optional with "" default) A spreadsheet identifier as returned by the mergGoogleWorksheetsLoaded message. If empty or no parameter passed then the worksheet will be the currently loaded worksheet.
message mergGoogleWorksheetDeleted pWorksheet
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pWorksheet - The identifier of the deleted worksheet.
message mergGoogleDeleteWorksheetError pWorksheet,pError
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pWorksheet - The identifier of the deleted worksheet.
- pError - An error message describing the reason for the failure to delete the worksheet.
Cells
command mergGoogleLoadCells [pWorksheet]
Load the cells for a given worksheet
Parameters:
- pWorksheet - (optional with "" default) A worksheet identifier as returned by the mergGoogleWorksheetsLoaded message. If empty or no parameter passed then the worksheet will be the currently loaded worksheet.
message mergGoogleCellsLoaded pWorksheet,pCellCount
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pWorksheet - The identifier of the worksheet that the cells were loaded from.
- pCellCount - The total number of cells loaded
message mergGoogleLoadCellsError pError
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pError - An error message describing the reason for the failure to load the cells.
function mergGoogleGetValueForCell pRow,pColumn,[pInputString]
Get the value of a cell in the loaded worksheet
Parameters:
- pRow - The cell row number
- pColumn - The cell column number
- pInputString - (optional with false default) If there is a formula for the cell then return that instead of the result value
Returns objc-string
function mergGoogleGetAllCellValues [pInputString]
Get all the cells of the loaded worksheet in tab and return delimited format
Parameters:
- pInputString - (optional with false default) If there is a formula for the cell then return that instead of the result value
Returns objc-string
command mergGoogleSetValueForCell pRow,pColumn,pValue,[pWorksheet]
Set the value of a cell in a given worksheet. It's not necessary to load the worksheet cells in order to set the value of a cell.
Parameters:
- pRow - The cell row number
- pColumn - The cell column number
- pValue - The value to set the cell to
- pWorksheet - (optional with "" default) A spreadsheet identifier as returned by the mergGoogleWorksheetsLoaded message. If empty or no parameter passed then the worksheet will be the currently loaded worksheet.
message mergGoogleCellValueSet pRow,pColumn
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pRow -
- pColumn -
message mergGoogleSetCellValueError pError
Sent to the control that called mergGoogleSpreadsheetsInitialize.
Parameters:
- pError - An error message describing the reason for the failure to set the cell value.