-
Posts
12 -
Joined
-
Last visited
Reputation Activity
-
timmorrisdesign reacted to rice.shawn in Reveal current open Microsoft Word Document (2011 version) in Finder with HotKey
Use this as the applescript:
on alfred_script(q) tell application "System Events" set frontApp to the name of the first application process whose frontmost is true if (frontApp is "Microsoft Word") then set continueProcess to true else set continueProcess to false end if end tell if continueProcess then tell application "Microsoft Word" to set documentName to path of active document as alias tell application "Finder" open the container of documentName activate select documentName end tell end if end alfred_script There's probably a more efficient way to do this, but this way works.
-
timmorrisdesign reacted to dfay in Reveal current open Microsoft Word Document (2011 version) in Finder with HotKey
I got this to work by changing the Run NSAppleScript to the less foolproof but working:
on alfred_script(q)
tell application "Microsoft Word" to set documentName to path of active document as alias tell application "Finder" to open the container of documentName end alfred_script the other code that I deleted from Shawn's version was checking if Word was active but in my testing it never returned True, so it never actually ran the two tell statements above. -
timmorrisdesign reacted to rice.shawn in Reveal current open Microsoft Word Document (2011 version) in Finder with HotKey
It might be system dependent (I didn't really check that as much). I know that I got it to work on my machine.
I got the actual string "Microsoft Word" by running an applescript from the script editor:
delay 2 tell application "System Events" set frontApp to the name of the first application process whose frontmost is true return frontApp end tell For me, that returned "Microsoft Word"; if you run that same script, then it might be that the string returned is slightly different. Well, in that two seconds, I had to switch over to Word, but it worked then.
You can get rid of this check and still have it be reliable by making the hotkey contextual to work only within Microsoft Word. To do this, double-click on the "hotkey" and press the "Related Apps" tab. Then add Microsoft Word.
Another possibility is that it is opening the folder but not putting focus on it. Is that true?