This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter = NoteStore.NoteFilter() | |
filter.ascending = False | |
spec = NoteStore.NotesMetadataResultSpec() | |
spec.includeTitle = True | |
ourNoteList = noteStore.findNotesMetadata(authToken, filter, 0, 100, spec) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
set _app to item 1 of (every process whose frontmost is true) | |
display dialog (name of _app as text) | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get list of notebooks linked to this account | |
linkedNotebooks = noteStore.listLinkedNotebooks(authToken) | |
bizLinkedNotebook = None | |
# grab the first business notebook for use in this example | |
for lnb in linkedNotebooks: | |
if hasattr(lnb, 'businessId'): | |
# this links a business notebook to our user's account | |
bizLinkedNotebook = lnb | |
print "Choosing notebook: %s" % bizLinkedNotebook.shareName | |
break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create the local notebook object | |
bizNotebook = Types.Notebook() | |
# Give it a name | |
bizNotebook.name = 'Example Business Notebook' | |
# Create the notebook using the business NoteStore | |
bizNotebook = bNoteStore.createNotebook(bAuthToken, bizNotebook) | |
# First, get the SharedNotebook instance for the notebook we just made | |
sharedBizNotebook = bizNotebook.sharedNotebooks[0] | |
# Create a LinkedNotebook instance | |
linkedBizNotebook = Types.LinkedNotebook() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get a list of all linked notebooks from the non-business | |
# NoteStore to which our user has access. | |
lNotebooks = noteStore.listLinkedNotebooks(authToken) | |
# compile a list of business notebooks from linked | |
# notebook list | |
bNotebooks = [] | |
for (lnb in lNotebooks): | |
# all business notebooks will have `businessId` set | |
if hasattr(lnb, 'businessId'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, get the SharedNotebook instance for the notebook we just made | |
# this represents our access to the notebook we just created | |
sharedBizNotebook = bizNotebook.sharedNotebooks[0] | |
# Create a LinkedNotebook instance | |
linkedBizNotebook = Types.LinkedNotebook() | |
# Assign it the share key and name of our business notebook | |
linkedBizNotebook.shareKey = sharedBizNotebook.shareKey | |
linkedBizNotebook.shareName = bizNotebook.name | |
# Assign the user who owns the notebook | |
linkedBizNotebook.username = bAuthResult.user.username |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create the local notebook object | |
bizNotebook = Types.Notebook() | |
# Give it a name | |
bizNotebook.name = 'Sample Business Notebook' | |
# Create the notebook | |
bizNotebook = bNoteStore.createNotebook(bAuthToken, bizNotebook) | |
# Update the notebook with a BusinessNotebook member | |
bizNotebook.businessNotebook = Types.BusinessNotebook() | |
# Provide a description which will appear in the library | |
bizNotebook.businessNotebook.notebookDescription = "My Awesome Sample Business Notebook" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
linkedNotebooks = noteStore.listLinkedNotebooks(authToken) | |
for lnb in linkedNotebooks: | |
op = lnb.shareName | |
if hasattr(lnb, 'businessId'): | |
op += " -- Business" | |
print op |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bSharedNotebooks = bNoteStore.listSharedNotebooks(bAuthToken) | |
print "You have access to %d shared notebooks in this business account." % len(bSharedNotebooks) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bAuthToken = bAuthResult.authenticationToken | |
bNoteStore = getNoteStoreInstance(bAuthToken, userStore) # function defined earlier | |
bSharedNotebooks = bNoteStore.listSharedNotebooks(bAuthToken) | |
print "There are %d shared notebooks in this business account." % len(bSharedNotebooks) |