def subscribeEvent_reply_(self, event, reply): """ handles a 'Subscribe to...' event""" filelist = event.paramDescriptorForKeyword_(aeKeyword(keyDirectObject)) fileURLData = filelist.data() url = buffer(fileURLData.bytes(),0,fileURLData.length()) url = str(url) print >>sys.stderr,("Subscribe to :"+url) util.idle_add(self.gp.subscribe_to_url, url) result = NSAppleEventDescriptor.descriptorWithInt32_(42) reply.setParamDescriptor_forKeyword_(result, aeKeyword('----'))
def subscribeEvent_reply_(self, event, reply): """ handles a 'Subscribe to...' event""" filelist = event.paramDescriptorForKeyword_(aeKeyword(keyDirectObject)) fileURLData = filelist.data() url = buffer(fileURLData.bytes(),0,fileURLData.length()) url = str(url) print(("Subscribe to :" + url), file=sys.stderr) util.idle_add(self.gp.subscribe_to_url, url) result = NSAppleEventDescriptor.descriptorWithInt32_(42) reply.setParamDescriptor_forKeyword_(result, aeKeyword('----'))
def openFileEvent_reply_(self, event, reply): """ handles an 'Open With...' event""" urls = [] filelist = event.paramDescriptorForKeyword_(aeKeyword(keyDirectObject)) numberOfItems = filelist.numberOfItems() for i in range(1,numberOfItems+1): fileAliasDesc = filelist.descriptorAtIndex_(i) fileURLDesc = fileAliasDesc.coerceToDescriptorType_(aeKeyword(typeFileURL)) fileURLData = fileURLDesc.data() url = buffer(fileURLData.bytes(),0,fileURLData.length()) url = str(url) util.idle_add(self.gp.on_item_import_from_file_activate, None,url) urls.append(str(url)) print >>sys.stderr,("open Files :",urls) result = NSAppleEventDescriptor.descriptorWithInt32_(42) reply.setParamDescriptor_forKeyword_(result, aeKeyword('----'))
def openFileEvent_reply_(self, event, reply): """ handles an 'Open With...' event""" urls = [] filelist = event.paramDescriptorForKeyword_(aeKeyword(keyDirectObject)) numberOfItems = filelist.numberOfItems() for i in range(1, numberOfItems + 1): fileAliasDesc = filelist.descriptorAtIndex_(i) fileURLDesc = fileAliasDesc.coerceToDescriptorType_(aeKeyword(typeFileURL)) fileURLData = fileURLDesc.data() url = buffer(fileURLData.bytes(),0,fileURLData.length()) url = str(url) util.idle_add(self.gp.on_item_import_from_file_activate, None,url) urls.append(str(url)) print(("open Files :",urls), file=sys.stderr) result = NSAppleEventDescriptor.descriptorWithInt32_(42) reply.setParamDescriptor_forKeyword_(result, aeKeyword('----'))