We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 139df49 commit c715316Copy full SHA for c715316
commands/system/toggle-desktop-icons.applescript
@@ -26,8 +26,20 @@ end if
26
27
do shell script "defaults write com.apple.finder CreateDesktop -bool " & NewSet
28
29
-tell application "Finder"
30
- quit
+tell application "Finder" to quit
+
31
+set inTime to current date
32
+repeat
33
+ -- check Finder process not exist
34
+ tell application "System Events"
35
+ if "Finder" is not in (get name of processes) then exit repeat
36
+ end tell
37
+ -- if repeat run for 10s, exit repeat
38
+ if (current date) - inTime is greater than 10 then exit repeat
39
+ delay 0.2
40
+end repeat
41
42
+tell application "Finder"
43
try
44
activate
45
end try
0 commit comments