Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Use AppleScript to better work with Spaces System 10.5
I found this post on another site that has some cool AppleScripts for working with Spaces via keyboard shortcuts. Specifically, the scripts allow:
  • Assign to All Spaces: assigns the frontmost window to all spaces.
  • Assign to Space X: opens an input dialog asking you which space to assign the frontmost window to.
  • Collect on Current Space: brings all windows from the frontmost application to the current space.
  • Remove Assignments: remove any application assignments the frontmost window may have.
[robg adds: I haven't tested these, and I borrowed the above descriptions of the scripts directly from the author's site.]
    •    
  • Currently 1.50 / 5
  You rated: 2 / 5 (4 votes cast)
 
[14,739 views]  

10.5: Use AppleScript to better work with Spaces | 3 comments | Create New Account
Click here to return to the '10.5: Use AppleScript to better work with Spaces' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Use AppleScript to better work with Spaces
Authored by: jonn8n on Dec 26, '07 10:26:26AM
I've posted a library of AppleScript routines for working with Spaces that may be of interest:

http://bbs.applescript.net/viewtopic.php?id=23453

Jon

[ Reply to This | # ]
10.5: Use AppleScript to better work with Spaces
Authored by: S Barman on Dec 26, '07 11:36:53AM
The various functions look interesting. However, I would change the last function to use "tr" instead of perl:

on make_lowercase(the_string)
   return do shell script "echo " & quoted form of the_string & " | /usr/bin/tr '[:upper:]' '[:lower:]'"
end make_lowercase
In the original script, you assume the character set locale to work with utf-8. Although utf-8 is more-or-less universal, it does have some problems with accented characters in non-English languages. The "tr" program respects current locale settings, which is more friendly to non-English character sets.

[ Reply to This | # ]
10.5: Use AppleScript to better work with Spaces
Authored by: jonn8n on Dec 26, '07 11:53:31AM
This is what I get in my testing:
{make_lowercase("JØnathan"), make_lowercase_alt("JØnathan")}
-->{"jønathan", "jØnathan"}

on make_lowercase(the_string)
	return do shell script "echo " & quoted form of the_string & " | /usr/bin/perl -pe 'use encoding utf8; s/(\\w)/\\L$1/gi'"
end make_lowercase


on make_lowercase_alt(the_string)
	return do shell script "echo " & quoted form of the_string & " | /usr/bin/tr '[:upper:]' '[:lower:]'"
end make_lowercase_alt

Jon

[ Reply to This | # ]