• 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: Positioning Items on the Desktop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Positioning Items on the Desktop


  • Subject: Re: Positioning Items on the Desktop
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 25 Oct 2013 13:19:38 +1100

On 25 Oct 2013, at 12:19 PM, Christopher Stone <email@hidden> wrote:

I don't like the the dot that's invaded the name-space, although I don't just hate it.  The problem is that it's a bit hard for me to see, and background color can distort my ability to easily perceive the color of the label.  I don't really think this is an improvement but instead a change simply for the sake of change.

I don't think it's just for the sake of change. One difference between tags and the old Finder labels is that a file can have more than one tag, and if you apply a couple, you will see (or not, perhaps :-() two overlapping dots. So the UI had to change somehow.

The Desktop's grid doesn't allow for the spacing I want, and for that matter if I accidentally hit the wrong key combo I can unintentionally frell my careful arrangement - but the solution is thankfully quite simple due to Applescript.

Indeed.

Anyway I thought I'd pass this one along.

OK, let's assume for a moment you couldn't use Satimage.osax. And let's assume you don't even want to use regular expressions (I can hear you screaming now). 

Let's further assume you find using "run script" inside a Finder tell block to make a list somewhat, well, distasteful ;-) What could you do? Save this in an ASObjC library:

use framework "Foundation"
on makeListsFrom:desktopPositionList
set theScanner to current application's NSScanner's scannerWithString:desktopPositionList -- make scanner
set theNames to {} -- to store results
set thePositions to {} -- to store results
set whiteSpace to current application's NSCharacterSet's whitespaceCharacterSet() -- make character set for trimming
repeat
set {theResult, aName} to theScanner's scanUpToString:" {" intoString:(reference) -- get name
if theResult as integer = 0 then exit repeat -- result of 0 menas none found
set end of theNames to (aName's stringByTrimmingCharactersInSet:whiteSpace) as text -- add trimmed name to list
theScanner's scanString:"{" intoString:(missing value) -- scan past {
set {theResult, aNum} to theScanner's scanInt:(reference) -- scan an integer
theScanner's scanString:"," intoString:(missing value) -- scan past ,
set {theResult, anotherNum} to theScanner's scanInt:(reference) -- scan an integer
set end of thePositions to {aNum as integer, anotherNum as integer} -- add position to list
theScanner's scanString:"}" intoString:(missing value) -- scan past }
end repeat
return {theNames, thePositions} as list
end makeListsFrom:

And call it like this:

use theLib : script "<name of lib here>"
set desktopPositionList to "
Catch All                   {45, 62}
[...]
Saved Fldrs 08-07 222831    {871, 64}
"
set {theNames, thePositions} to theLib's makeListsFrom:desktopPositionList

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

  • Prev by Date: Mavericks Problems?
  • Next by Date: Applescript complaining about accessing and writing to a file
  • Previous by thread: Mavericks Problems?
  • Next by thread: Re: Positioning Items on the Desktop
  • Index(es):
    • Date
    • Thread