Categorie
tecnologia

how to open a new Finder tab into a certain folder with total finder and applescript

While working, many times I happen to need a new tab, opened into a certain folder into Finder (with total finder), so I wrote some applescript to do that. Then I put it into a small mac app store app called Shortcut, so that every time I need that folder I just press a keystroke (in my case, that’s CMD+C) and voilà, I get it. Should you need to do something similar, here is the code.

property the_path : "/Users/solignani/Google Drive/c-avv19/doc di lavoro/pratiche/"
set the_folder to (POSIX file the_path) as alias
delay 0.5 -- necessario per evitare che i tasti vengano premuti assieme
tell application "Finder"
activate
if window 1 exists then
tell application "System Events"
keystroke "t" using {command down} -- apre un nuovo pannello
end tell
set target of window 1 to the_folder
else
open the_folder
end if
end tell
Ti è piaciuto il post? Usa qualche secondo per supportare Tiziano Solignani su Patreon!
Become a patron at Patreon!

Di Tiziano Solignani

L'uomo che sussurrava ai cavilli... Cassazionista, iscritto all'ordine di Modena dal 1997. Mediatore familiare. Counselor. Autore, tra l'altro, di «Guida alla separazione e al divorzio», «Come dirsi addio», «9 storie mai raccontate», «Io non avrò mai paura di te». Se volete migliorare le vostre vite, seguitelo su facebook, twitter e nei suoi gruppi. Se volete acquistare un'ora (o più) della sua attenzione sui vostri problemi, potete farlo da qui.

Tu che cosa ne pensi?

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.

%d blogger hanno fatto clic su Mi Piace per questo: