'Go to Folder' Outlook 2011

Discussion in 'Mac Programming' started by Froggvox, Oct 14, 2014.

  1. Froggvox macrumors newbie

    Joined:
    Oct 6, 2014
    #1
    Hi All,

    I have another AppleScript query... :)

    Pressing the key combo 'Command Shift M' opens a dialog box that allows you to move an email message to a particular folder (via a search function).

    Is there a script that can allow me to 'open' or 'go to folder' in outlook, using the same search function?

    In microsoft outlook (windows) there is a key combo 'Control Y' that allows you to enter a folder name and it will scroll down and open that folder - i want this is outlook 2011 mac

    Any help would be greatly appreciated! :)

    Thank you

    Trent
     
  2. kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #2
    Not exactly what you want but you can give it a try.

    Display dialog box :

    Code:
    on run {}
    	set {button_pressed, text_returned} to {button returned, text returned} of (display dialog "Enter the name of the mail folder." with title "'Go to Folder' Outlook 2011" default answer "INBOX" buttons {"Cancel", "OK"} default button 2)
    	if button_pressed is "OK" then
    		tell application "Microsoft Outlook"
    			activate
    			if view of the first main window is not equal to "mail view" then
    				set view of the first main window to mail view
    			end if
    			set messageAccount to first imap account
    			set folderNames to name of mail folders of messageAccount
    			if text_returned is in folderNames then
    				set selected folder to the folder named text_returned
    			end if
    		end tell
    	end if
    end run
    
    Choose from list :

    Code:
    on run {}
    	tell application "Microsoft Outlook"
    		if view of the first main window is not equal to "mail view" then
    			set view of the first main window to mail view
    		end if
    		set messageAccount to first imap account
    		set folderNames to name of mail folders of messageAccount
    		choose from list folderNames
    		if the result is not false then
    			set folderName to item 1 of the result
    			set selected folder to the folder named folderName
    		end if
    	end tell
    end run
    
    Info : http://apple.stackexchange.com/questions/53998/outlook-2011-keyboard-shortcut-for-going-to-inbox and http://www.matthewjmiller.net/howtos/mac-outlook-2011-move-to-folder-macro/
     
  3. Froggvox thread starter macrumors newbie

    Joined:
    Oct 6, 2014
    #3
    Thank you, however when i copy and past your script into the editor - i get a Syntax Error: Expected class name but found identifier. (on the main window text)

    Any ideas?
     

Share This Page