Как каждый повторно запускает Средство поиска программно?

Используйте таймер , Включил свойство.

5
задан user2110045 26 February 2013 в 06:32
поделиться

3 ответа

Send it a quit event using AppleScript, then send it an activate event:

//tell Finder to quit
NSAppleScript *restartFinder = [[NSAppleScript alloc] initWithSource:@"tell application \"Finder\" to quit"];
[restartFinder executeAndReturnError:nil];

EDIT: add a delay to make sure Finder is ready to receive an activate event. On my machine, sometimes it needs this delay, sometimes it doesn't:

//delay 1 second
restartFinder = [[NSAppleScript alloc] initWithSource:@"delay 1"];
[restartFinder executeAndReturnError:nil];

(...end EDIT)

//tell Finder to activate
restartFinder = [[NSAppleScript alloc] initWithSource:@"tell application \"Finder\" to activate"];
[restartFinder executeAndReturnError:nil];
5
ответ дан 14 December 2019 в 13:41
поделиться

Finder is kept alive by the system, so you can just kill it and it will automatically relaunch. I use killall Finder to accomplish this.

3
ответ дан 14 December 2019 в 13:41
поделиться

'Relaunch' almost certainly just sends a kill signal to the Finder.

-1
ответ дан 14 December 2019 в 13:41
поделиться