- Kā paslēpt lietotņu ikonas no OS X palaišanas diska ar skriptu

Kā paslēpt lietotņu ikonas no OS X palaišanas diska ar skriptu

Launchpad operētājsistēmā OS X ir lielisks ne tikailietotņu palaišana, kā arī to organizēšana. Launchpad izveidotās mapes nav īstas mapes, kas izveidotas mapē Lietojumprogrammas, un tas ļauj jums bieži izmantotās lietotnes sagrupēt atšķirīgi no instalēto lietotņu saraksta. Vienīgā problēma, kas saistīta ar lietotņu ikonām Launchpad, ir tā, ka tās var pārvietot tikai uz mapi, nevis pilnībā tās paslēpt. Tas ir līdzīgs netīrumu slaucīšanai zem paklāja; lietotņu ikonas joprojām atrodas, lai arī tās ir paslēptas mapē un tikai redzamības vietā. Labi ir tas, ka jūs varat noņemt lietotņu ikonas no Launchpad ar vienkāršu mazu skriptu un neuztraucieties par lietotnes izdzēšanu no jūsu sistēmas.

Mac-Launchpad

Lai izdzēstu ikonas no Launchpad, vispirms ir jāatver AppleScript redaktors un tajā jāielīmē sekojošais skripts.

on open the_items
my Lighten_LaunchPad(the_items)
end open
on Lighten_LaunchPad(the_items)
repeat with the_item in the_items
set the_item to the_item as alias
--try
tell application "Finder"
set nameString to name of the_item
set sost to (my get_the_name(nameString)) as string
end tell
display dialog "Are you sure you want to remove "" & sost & "" from the Launchpad? The app itself won"t be deleted."         try
set my_command to "sqlite3 ~/Library/Application\ Support/Dock/" & "*.db "DELETE from apps WHERE title=" & (quoted form of sost) & ";";osascript -e "tell application "Dock" to quit""
do shell script my_command
on error the error_message number the error_number
activate
if the error_number is not -128 then
if the error_number is 1 then
set the error_text to "Error: " & the error_number & ". " & "You probably have too many old versions of the LaunchPad database file." & return & return & " To fix that, move some old ones out of ~/Library/Application Support/Dock. You can safely move any file with a name that ends with ".db" or ".db.backup" except for the most recently modified one." & return & return & "Do you want me to open that folder for you?"                     display dialog the error_text buttons {"Yes, please open it.", "Cancel"} default button 1
if button returned of the result is "Yes, please open it." then
do shell script "open" & space & quoted form of POSIX path of (path to application support folder from user domain) & "Dock"
end if
error number -128
else
set the error_text to "Error: " & the error_number & ". " & the error_message                     display dialog the error_text buttons {"Cancel"} default button 1
end if
else
error number -128
end if
end try
end repeat
display dialog "All done!" buttons {"OK"} default button 1
end Lighten_LaunchPad
on get_the_name(nameString)
tell AppleScript
set olD to text item delimiters
set text item delimiters to "."
set reqItem to -1
if last item of nameString = "." then set reqItem to -2
set theName to text item reqItem of nameString
--try
set theNameNoExt to ((text items 1 through (reqItem - 1) of nameString) as string)
set text item delimiters to olD
return {theNameNoExt}
end tell
end get_the_name
on run
set the_items to ((choose file) as list)
Lighten_LaunchPad(the_items) end run

Pēc tam saglabājiet skriptu kā lietotni visur, kur vēlaties. Tagad palaidiet šo lietotni, un tiks atvērts meklētāja logs. Atlasiet lietotni, kuru vēlaties noņemt no Launchpad, un apstipriniet, kad tā jautā, vai tiešām vēlaties izdzēst tās ikonu. Tagad Dock tiks restartēts, un lietotne vairs nebūs pieejama no Launchpad. Vienkārši atkārtojiet to visām ikonām, kuras vēlaties noņemt no Launchpad, un tas ir jādara.

Ja vēlaties atjaunot jebkuras lietotnes ikonuLaunchpad, jums šajā gadījumā nav jāpaļaujas uz šo skriptu (vai jebkuru citu rīku); vienkārši atveriet lietojumprogrammu mapi un velciet un nometiet lietotnes ikonu uz Launchpad.

Jābrīdina, ka ikonu noņemšana un pievienošana, piemēram,tas neskar viņu Launchpad mapju struktūru. Pievienojot atpakaļ lietotnes ikonu, kas pirms mapes noņemšanas tika sakārtota mapē, tā netiks atjaunota iepriekšējā pozīcijā, un jums tā atkal būs manuāli jānolaiž izvēlētajā mapē.

Ja jums ir labi, ja šim nolūkam ir jāinstalē cita lietotne, ieteicams izmēģināt Launchpad vadību.

[caur Mac OS X padomi]

Komentāri