• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: El Capitan Wrecks my Desktop Sweeper Script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: El Capitan Wrecks my Desktop Sweeper Script


  • Subject: Re: El Capitan Wrecks my Desktop Sweeper Script
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 02 Oct 2015 03:18:03 -0500

On Oct 02, 2015, at 03:00, Christopher Stone <email@hidden> wrote:
This runs in ~ 0.3 seconds, although I'm not moving any files as yet.
______________________________________________________________________

Hey Folks,

This script using the Satimage.osax runs in ~ 0.11 seconds, although again I'm not moving any files yet.

I've been thinking about doing a little smarter routing – perhaps using some routing codes like 'km' for Keyboard Maestro and 'wk' for working.

Anyhow.  Hopefully someone else will find this useful too.

--
Best Regards,
Chris

-------------------------------------------------------------------------------------------
# Auth: Christopher Stone <email@hidden>
# dCre: 2012/09/30 16:51
# dMod: 2015/10/01 13:58
# Appl: Finder
# Task: Sweep Stuff off the desktop in an organized fashion.
#     : Exclusion list.
#     : Items labeled gray, green, or red are excluded.
# Libs: Only OSX components used.
# Osax: None 
# Tags: @Applescript, @Finder, @Sweep, @Desktop
# Vers: 2.00b01
-------------------------------------------------------------------------------------------
property defaultWindowPositionY : 23 -- El Capitan
-------------------------------------------------------------------------------------------
property exlusionList : items 1 thru -2 of {¬
  "Access", ¬
  "Action List", ¬
  "bak", ¬
  "Catch All", ¬
  "dd PerlDmp", ¬
  "Desk Notes", ¬
  "Kinesiology", ¬
  "Links", ¬
  "ll test.pl", ¬
  "Meta", ¬
  "OSX Notes", ¬
  "Pending", ¬
  "Proj Notes", ¬
  "Ref Files", ¬
  "sa Scripts", ¬
  "ss Scr-Shot", ¬
  "Sweep", ¬
  "Swept", ¬
  "TEST.ws", ¬
  "Working", ¬
  "tags.txt", ¬
  ""}
-------------------------------------------------------------------------------------------
# Separation between file-extensions & folder name must be at least 5 spaces.
# Multiple file-extensions MUST be separated by one space.
property fileExtFilters : text 2 thru -2 of "
dmg                                     Disk_Images
flv mov mp4                             Movie_Files
gif jpg png                             Image_Files
rtf rtfd                                RTF_Files
scpt                                    Script_Files
sit zip                                 Compressed_Archives
txt                                     Text_Files
textClipping                            Clipping_Files
webarchive                              Web_Archives
webbookmark webloc                      Web_Bookmarks
worksheet                               BBEdit_Worksheets
"
-------------------------------------------------------------------------------------------
set theDesktopFolder to path to desktop
set folderNameList to {}
set contentList to {}

set AppleScript's text item delimiters to linefeed
repeat with i in (paragraphs of fileExtFilters)
  set typeList to reverse of (words of i)
  set typeFolderName to first item of typeList
  set typeList to rest of typeList
  set end of folderNameList to typeFolderName
  set end of contentList to paragraphs of ((glob "*" of extension typeList from theDesktopFolder as alias) as text)
end repeat

set AppleScript's text item delimiters to ":"
tell application "Finder"
  repeat with i in contentList
    repeat with n in i
      set _item to contents of n
      if last text item of _item is in exlusionList then
        set _item to 0
      else if (get label index of (_item as alias)) is in {2, 6, 7} then
        set _item to 0
      end if
      if _item = 0 then
        set (contents of n) to 0
      else
        set (contents of n) to (contents of n) as alias
      end if
    end repeat
    set (contents of i) to aliases of (contents of i)
  end repeat

  

end tell

{folderNameList, contentList}

-------------------------------------------------------------------------------------------


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >El Capitan Wrecks my Desktop Sweeper Script (From: Christopher Stone <email@hidden>)
 >Re: El Capitan Wrecks my Desktop Sweeper Script (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: El Capitan Wrecks my Desktop Sweeper Script
  • Next by Date: Best Practices
  • Previous by thread: Re: El Capitan Wrecks my Desktop Sweeper Script
  • Next by thread: Re: El Capitan Wrecks my Desktop Sweeper Script
  • Index(es):
    • Date
    • Thread