Monday, December 11, 2017

#1 2015-10-31 03:07:41 pm

tneison
Member
Registered: 2015-04-03
Posts: 66

Make 'Choose Folder' float above all other windows

Using Script Editor I have been unable to find a way to make my Choose Folder window float above all other windows.

Applescript:

set pathToFolder to choose folder with prompt "Choose a folder or drive"

This is necessary because the Choose Folder window is triggered when the user selects an option from a Menu Bar menu item (the same one I posted about here: http://macscripter.net/viewtopic.php?id=44383). Normally the app running the Menu Bar menu is not in the foreground so the resulting window appears below other windows.

Any ideas as to how to accomplish this in Script Editor?

Offline

 

#2 2015-10-31 03:11:03 pm

tneison
Member
Registered: 2015-04-03
Posts: 66

Re: Make 'Choose Folder' float above all other windows

BTW I posted this in the ASOC forum because I assume the answer will probably use ASOC.

Offline

 

#3 2015-10-31 03:15:29 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11482
Website

Re: Make 'Choose Folder' float above all other windows

try

Applescript:

current application's NSApplication's sharedApplication()'s activateIgnoringOtherApps:true

this forces the application to become active (to the foreground).


regards

Stefan

Offline

 

#4 2015-10-31 03:28:27 pm

tneison
Member
Registered: 2015-04-03
Posts: 66

Re: Make 'Choose Folder' float above all other windows

Nice. That did the trick. Thanks!

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)