Search code examples
applescript

Open new Finder window using AppleScript


How can I open a new window of Finder in AppleScript? I am using an if else statement to open a window. I tried an Osascript command but it gave me a syntax error. The code is below:

if the button returned of the result is "Sleep" then
    tell app "Finder" to go to sleep
if the button returned of the result is "Open Finder" then
    osascript -e 'tell application "Finder" to open new window'
else
    display dialog current time
end if

Solution

  • Try:

    tell application "Finder" to make new Finder window