2011-04-30, 12:36
#1
Allright, ibland kan det vara sknt att bara kunna markera en bunt filer och gra en ny mapp av dessa. Det r en stor timesaver tycker jag. Tnkte dela med mig av min upptckt till er.
Vi kommer anvnda oss av:
- Automator
- Apple Scripts
1)
ppna Automator (Sk efter det i spotlight)
2)
Vlj "Tjnst"
http://cl.ly/1W34450v2n0Z2p0V2u0K
3)
Sk efter "Apple Script" och dra in den till programet
http://cl.ly/3b1s2A1v010j153X2T0Y
4)
ndra 'parametrarna' till "Tjnsten tar emot markerad {Filer eller mappar} i {Finder}
http://cl.ly/1G0c2e0G3K3n2x112s2r
5)
Klistra in fljande Apple Script istllet fr (* Your script goes here *), allt annat ska vara kvar
7) Kompilera scriptet (tryck p Hammaren) s ska allt se ut s hr (typ)
http://cl.ly/1H0l2r440O1K0x3b1K0p
8) Spara allt under ett passande namn, jag valde "Gather Finder Items Into a New Folder"
Artikeln om detta hittade jag p Lifehacker skriven av Whitson Gordon
Jag skrev om scriptet ytterst lite fr att f kl till 24.00 h istllet fr AM/PM
Lycka till!
Vi kommer anvnda oss av:
- Automator
- Apple Scripts
1)
ppna Automator (Sk efter det i spotlight)
2)
Vlj "Tjnst"
http://cl.ly/1W34450v2n0Z2p0V2u0K
3)
Sk efter "Apple Script" och dra in den till programet
http://cl.ly/3b1s2A1v010j153X2T0Y
4)
ndra 'parametrarna' till "Tjnsten tar emot markerad {Filer eller mappar} i {Finder}
http://cl.ly/1G0c2e0G3K3n2x112s2r
5)
Klistra in fljande Apple Script istllet fr (* Your script goes here *), allt annat ska vara kvar
Kod:
6) Line'n tell application "Finder" (* what files do you want to gather into a new folder? *) set selectedItems to selection if selectedItems is not {} then (* topLevelName assures the uppermost file-level-directory will be selected in case of multiple selections in list or column view. *) set topLevelName to name of item 1 of selectedItems (* silly set of workarounds to override vanilla AppleScript's lack of permission when playing in the .Trash folders *) set selectionPath to POSIX path of file ((item 1 of selectedItems) as string) set selectionPath to ((characters 1 thru ((offset of topLevelName in selectionPath) - 1)) in selectionPath) as string (* Modify path string to create a unique target folder using date and time *) set dateString to do shell script "date \"+%Y.%m.%d %a %I.%M.%S\"" -- this line broken out for easy editing set newFolder to selectionPath & (dateString) -- rearrange as you please; is set this way for proper name sorting (* more workarounds to allow playing in the .Trash *) do shell script "mkdir " & quoted form of newFolder set newFolder to (POSIX file newFolder) as alias move selectedItems to newFolder reveal newFolder end if end tell
Kod:
gr s att mappen fr det nuvarande datumet och tiden du utfrde 'the gathering', praktiskt som fan tycker jag.set dateString to do shell script "date \"+%Y.%m.%d %a %I.%M.%S\""
7) Kompilera scriptet (tryck p Hammaren) s ska allt se ut s hr (typ)
http://cl.ly/1H0l2r440O1K0x3b1K0p
8) Spara allt under ett passande namn, jag valde "Gather Finder Items Into a New Folder"
Artikeln om detta hittade jag p Lifehacker skriven av Whitson Gordon
Jag skrev om scriptet ytterst lite fr att f kl till 24.00 h istllet fr AM/PM
Lycka till!