Applescript help for a newbie

Discussion in 'Mac Programming' started by KurtangleTN, May 13, 2007.

  1. KurtangleTN macrumors 6502a

    Joined:
    Apr 2, 2007
    #1
    So i'm trying to make a script for quicksilver, so that I can reload my RSS feed program (Vienna)

    I got this

    tell application "System Events"
    tell process "Vienna"
    keystroke "r" using {command down}
    end tell
    end tell

    Now this will reload (well do Command + R which is the hotkey for refreshing in Vienna) if it's the active window, how do I make it so that it switches to Vienna before?

    Thanks
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    It'll be really annoying as the application will jump to the front but

    Code:
    tell application "your application name here"
    	activate
    end tell
    
    will activate whatever application you put in the appropriate place.
     
  3. KurtangleTN thread starter macrumors 6502a

    Joined:
    Apr 2, 2007
    #3
    Ah ok, so I'm probably just better off leaving it as it is.. or just command-tabbing.

    Thanks! :D
     
  4. lancestraz macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #4
    A better way is:
    Code:
    try
    	tell application "Vienna"
    		refresh all subscriptions
    	end tell
    end try
     
  5. KurtangleTN thread starter macrumors 6502a

    Joined:
    Apr 2, 2007
    #5
    When I tried that, It said connection error, and it crashed Vienna, did I do something wrong?
     
  6. lancestraz macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #6
    Ha. Weird. Works fine for me. How many times have you tried it? Maybe it was a fluke.
     
  7. KurtangleTN thread starter macrumors 6502a

    Joined:
    Apr 2, 2007
    #7
    I run Panther, and Vienna 2.1.2.2110/2110

    Maybe that could be doing something with it?

    Man I regret not getting Tiger.
     
  8. SC68Cal macrumors 68000

    Joined:
    Feb 23, 2006
  9. KurtangleTN thread starter macrumors 6502a

    Joined:
    Apr 2, 2007
    #9
    Code:
    2007-05-16 19:40:11.830 Vienna[450] attribute terminology dictionary not found for attribute applescriptContainer in class AbstractObject in suite NSCoreSuite
    
    2007-05-16 19:40:11.831 Vienna[450] attribute terminology dictionary not found for attribute applescriptContainer in class Folder in suite ViennaApp
    
    2007-05-16 19:40:11.833 Vienna[450] No readable name in dictionary
    Ok, this is what I got.

    Thanks for the help again :)
     

Share This Page