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
To open a new Finder window without opening a specific folder, click the Finder icon in the Dock, then choose File > New Finder Window or press Command-N.
The tell compound statement identifies the target of an AppleScript command or Apple event (as in tell app "Photoshop 5.5" ) followed by other AppleScript statements and an end tell .
Try:
tell application "Finder" to make new Finder window
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With