Jump to content

cremoer

Member
  • Posts

    11
  • Joined

  • Last visited

Posts posted by cremoer

  1. Hi there,

    I have a script, where the array for the JSON, which will be passed to Alfred again, looks like so:

    		result.append(
    			{"title": title,
    			"subtitle": arg,
    			"arg": arg,
    			"icon": {
    				"type": "filetype",
    				"???": "???"
    			} }
    			)

    What do I have to fill in for the ???, so that files are shown with their correct icons? PDFs with a pdf icon, jpgs with jpg icon and so on...

    Do I have to assign each individual filetype to an icon or is there a more generic way to achieve this?

  2. I changed the script a little bit, in that I don't pass the index as argument, but the path of the document as string and furthermore pass this to an "open file" action in Alfred, like so:

    app = Application('Tinderbox');
    
    function run() {
    
    	var items = [];
    
    	for (var i = 0; i < app.documents.length; i++) {
    		var doc = app.documents[i];
    		items.push({
    			title: doc.name(),
    			arg: doc.file().toString()
    		});		
    	}
    	
    	return JSON.stringify({items: items});
    }

    followed by:

     

    image.png.ed2151c83e845e7fbe9a6687e600b8b6.png

     

    Works, but does not seem to be the most elegant way. 

    Any other / better ideas to make the chosen document the frontmost / focused document in my app?

  3. 3 hours ago, deanishe said:

     

    I don't know about Tinderbox

     

    It’s a hard to describe app, unlike anything...

    Something in between note taking, mind mapping, planning, brain storming and so on. You also could create a website with it or track your expenses... as well as write a novel or plan your tasks. I will have a look on the script Filter in a few minutes, when I am home again. 

    Btw, you live in Essen? Then we are nearly neighbours, I come from Wuppertal 🌨😀

×
×
  • Create New...