Dropbox memo maker script

Discussion in 'Mac Programming' started by VideoBeagle, Jan 26, 2011.

  1. VideoBeagle macrumors 6502a

    Joined:
    Aug 17, 2010
    Location:
    App Q&A testing by request.
    #1
    I've made a little applescript and attached it to a folder in DropBox.

    From elsewhere, like work, I can drop a text file into the folder, and then on my G5 at home, it'll display a dialog with the contents of the text file. (using display dialog)



    Basicly, it's for me to have a reminder of something I need to do when I get home.

    However, I'm wondering if there's a better way to do this, as I've seen that only the first text file gets a message...no more are shown until the 1st dialog is Ok'd/Canceled.

    I believe Growl notifications would do multiple, but they don't stay on screen, to my knowledge.

    Anyone have any thoughts on this?
     
  2. VideoBeagle thread starter macrumors 6502a

    Joined:
    Aug 17, 2010
    Location:
    App Q&A testing by request.
    #2
    Reading up on GROWL scripting, loooks like it needs pre-written messages, so it won't work.

    Can anybody think of a better implementation?
     
  3. ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #3
    Growl will do this. You can have the notifications stay on screen until they are clicked, or they can auto-dismiss. They can also be whatever you want, so you don't have to actually prewrite them. Once you register your AppleScript "application", you can configure it however you want.

    http://growl.info/documentation/applescript-support.php
     
  4. VideoBeagle thread starter macrumors 6502a

    Joined:
    Aug 17, 2010
    Location:
    App Q&A testing by request.
    #4
    Huh...I had read that..or a similar page, and my impression was you had to give it a list of different messages at the start....so it can display read in variables?
     
  5. ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #5
    Of course. Instead of the stuff in " ", you can just as easily pass in a variable.
     
  6. Cojust macrumors newbie

    Joined:
    Jan 27, 2011
    #6
    I believe this is what you are looking for, what it does is that it takes the first file that is dropped into the folder, reads it and sends a growl notification. However, I have no idea how one would parse the file into readable text, it currently has a bunch of formatting stuff at the top. I would appreciate if you show me how you would do it :D
    Code:
    on adding folder items to this_folder after receiving added_items
    	set readfile to read item 1 of added_items as string
    	tell application "GrowlHelperApp"
    		set the allNotificationsList to ¬
    			{"Dropbox Notify"}
    		set the enabledNotificationsList to ¬
    			{"Dropbox Notify"}
    		register as application ¬
    			"Dropbox Notify" all notifications allNotificationsList ¬
    			default notifications enabledNotificationsList ¬
    			icon of application "Dropbox"
    		notify with name ¬
    			"Dropbox Notify" title ¬
    			"Dropbox Notify" description ¬
    			readfile application name "Dropbox Notify"
    	end tell
    end adding folder items to
    
     

Share This Page