Search posterous

Search all posts and users. Type a name, type a favorite song title, whatever! See what comes up.
  

More posterous blogs











More recommended blogs »

Here are posterous posts filed under automator...

Bryce says...

This application returns a filtered list of image URLs from a web page.

Click here to download:
get_posted_art_images.app.zip (41 KB)

Filed under: automator

Bryce says...

Filed under: automator

Bryce says...

Click here to download:
screen_capture.workflow.zip (90 KB)

Click here to download:
screengrab_-_7s_delay.workflow.zip (67 KB)

Click here to download:
screengrab.workflow.zip (67 KB)

Filed under: automator

Bryce says...

Filed under: automator

appleseed says...

OS X 10.6 有個重要但是不常被提及的改進是「服務」選單有了重大的改良,原本所有應用程式相關的服務都被擠在左上角應用程式名稱選單下,這種情況只要安裝的程式一多,要挑選相對的「服務」功能就變得非常困難、耗時。

10.6 的「服務」會根據不同的狀況只顯示可用的服務項目,同時在系統偏好設定中也有服務的設定頁面。除了應用程式的服務選單外,服務也可以分別安裝在「右鍵選選單」與 Finder 的 「動作選單」(齒輪按鈕)

中,並且還能指派快速鍵啟動,這樣的改進讓服務在「執行」上變得更加便利。另外透過機器人(Automator)還能自行製作服務項目,這點讓服務的應用更加廣泛!

這次先不介紹服務該如何設定,我要先介紹這個在 Mac OS X Automation 看到給 iPhoto 用的超酷服務:Send Photo to Everyone in the Picture。這個服務是包含在「IPHOTO SERVICES」這個組合包裡的其中之一,顧名思義就是它可以透過iPhoto最新的臉部辨識功能,替你找出照片中的人,並且自動將照片email給那些人!



安裝好「IPHOTO SERVICES」之後,到iPhoto的服務選單就可以看到如上圖這些新的服務,接下來你只要選擇哪些照片要寄出,然後選「Send Photo to Everyone in the Picture」就搞定了!


此外安裝完後在機器人中也會多出像是「New eMail to Detected People」這樣的動作可以套用到其他自製的機器人流程中。


類似這樣的好用服務在 Mac OS X Automation 還有不少,有興趣的人可以到那邊挖寶唷!

Filed under: Automator

divia says...

Click here to download:
First_Letters.workflow.zip (42 KB)

Lately I've been somewhat into memorizing some of my favorite quotations from books. The most effective method I've found for doing so has been converting each word of whatever text I'm trying to memorize to just the first letter, and trying to reconstruct the passage from that. Here's the theory behind why this is helpful:

This is the crucial concept of any type of memorization. The act of reading something you want to memorize fires different connections than the act of recalling. This means that simply reading a particular piece of text over and over again is going to be the long road to memorization. You need to let your brain practice recalling the data so it can strengthen the same pathways that will fire when you need to remember the information later on. You can’t practice recalling until the information is at least partially contained in your short term memory.
-How to Memorize Verbatim Text

So, say I want to memorize this passage from Pawn in Frankincense by Dorothy Dunnett:

The woman sitting there, straight and still on the bright velvet cushions, was not young; nor was she less than beautiful. The black hair, loose and shining, and deep, fell back over her shoulder and forward down to her waist; her chin was high above the pure line of her neck, which you could have held in one hand. Her eyebrows were black, and arched in pride, or surprise, or over some deep, long-held thought; and below the black, silky lashes, the wide eyes were packed full of straw.

Here's what it gets converted to:

T w s t, s a s o t b v c, w n y; n w s l t b. T b h, l a s, a d, f b o h s a f d t h w; h c w h a t p l o h n, w y c h h i o h. H e w b, a a i p, o s, o o s d, l-h t; a b t b, s l, t w e w p f o s.

The website that describes this method provides a helpful JavaScript tool for performing this conversion, but before too long I was finding copying text into the box on the website a little unwieldy. So, I grabbed the relevant regular expression from the JavaScript code (str.replace(/(\w)\w*/g,"$1")) and turned it into an OS X Service, a transformation that, luckily for me, Snow Leopard has made very easy. All the service does is grab some text, run a simple sed replace command (sed 's/\([a-zA-Z0-9]\)[a-zA-Z0-9]*/\1/g'), and output it.

In case this tool I've created could be at all useful to anyone else, I figured I might as well upload it.  To install it, just put it in either /Library/Services or ~/Library/Services.

Filed under: Automator

nathos says...

I previously described how to use Ruby and Automator to build a custom Mac OS X service. Today, in celebration of International Talk Like a Pirate Day, I present a quick-n-dirty text Pirate-ization service for Mac OS X Snow Leopard:

Before we start, you will need to install the Booty Ruby gem into your system's default gem repository. If you haven't installed a custom version of Ruby, go ahead and follow the instructions in the Booty readme. Otherwise, make sure you execute commands using "/usr/bin/gem".

If you have no clue what I'm talking about, just open a Terminal window and type the following (one line at a time):

gem sources -a http://gems.github.com
sudo gem install mdeering-booty

Now to create our service. Launch Automator and select the "Service" template. Be sure to enable the "replaces selected text' option: 

Next, as before, add the "Run Shell Script" action to your workflow and select "/usr/bin/ruby" as your shell. Then enter the following code into the shell script text box:

Lastly, save your new service (I called mine 'Pirate-ize!') and give it a try: select some editable text (in Safari, TextEdit, iChat, even your favorite Twitter client), then right-click the text & select 'Pirate-ize!'. Your selected text should be replaced with appropriately piratey prose. Remember, you can set a custom keyboard shortcut for your Pirate-ize service in 'System Preferences -> Keyboard -> Keyboard Shortcuts'.

Now get to talkin' piratey ya lubber!

[If you don't feel like creating this service from scratch, you can download this zip and place the resulting Automator workflow in your ~/Library/Services folder. You will still need to install the Booty Ruby gem.]

Filed under: Automator

Victor says...

         
Click here to download:
Todays_photos.zip (547 KB)

To make my photos square used a script that i came up with when i experimented with Automator. You can download it here. (Only works with Mac OS X, since it's a Automator action)

You can see them at a bit higher quality over at my Flickr.

Filed under: Automator

nathos says...

Building Snow Leopard Services with Automator & Ruby

Yesterday, Justin Williams posted a quick how-to on using Automator in Mac OS X Snow Leopard to create a service that helps you build clean Amazon affiliate links.

Justin's instructions create a workflow that requires you to manually select just the item's ASIN code, then uses AppleScript to concatenate the rest of the short URL together. He notes: 

"The workflow on this isn’t perfect given that you can’t just copy in the entire URL, but given AppleScript’s lack of regular expression functionality, this was the best route I could think of taking."

I thought to myself, "hey, that'd be super-easy to do in Ruby". After a quick perusal of the available Automator actions, I discovered that you can select a Ruby, Python or Perl interpreter with the "Run Shell Script" action. Oh snap!
[Note: apparently the Ruby/Python/Perl support in Automator isn't new. It's there in 10.5 too]

As Justin noted, your typical Amazon URL is way too long and has lots of icky cruft in it. Take this link to the new Beatles Box Set, for example:

http://www.amazon.com/gp/product/B002BSHWUU/ref=s9_simz_gw_s0_p15_i1?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SA8PWTFHCQY477B6WQ8&pf_rd_t=101&pf_rd_p=470938631&pf_rd_i=507846/ref=nosim/nathos-20

I know. Eww. In contrast, the shortest possible link for an item basically has Amazon's base URL, the item's ASIN code, and an affiliate ID:

http://www.amazon.com/dp/B002BSHWUU/ref=nosim/nathos-20

With a head start from a guy at Microsoft (!) and some quick expression testing with Rubular, I had a working regex and the start of an improved "Create Amazon Affiliate Link" service:

To recreate this service on your own, you'll need to launch Automator and select the "Service" template for your workflow.

You may have noticed that your 'Services' menu (under the Application menu) is far less cluttered than in Mac OS X 10.5. This is because Snow Leopard now uses data detectors to determine if a given service applies to the current app or selection. In this case, we only want our service to be available if a URL has been selected. To do so, set the "Service receives selected" option at the top of the workflow to "URLs". I also suggest that you restrict your service to Safari, so go ahead select it from the adjacent drop-down menu.

Next, scroll to or search for the "Run Shell Script" action, and drag it into your workflow. Set the "Shell:" to "/usr/bin/ruby" and then type or paste in the following:

Change the value of 'affiliate_id' (shown here as my ID, 'nathos-20') to your own Amazon affiliate ID. Don't forget the '-20' at the end. Also, make sure the appropriate lines are properly indented.

This hunk of code features a fancy regular expression that extracts the ASIN code from any Amazon URL. It then concatenates the base Amazon URL, the ASIN, and an affiliate ID together into a final short URL. Lastly, it checks to see if the URL you processed actually contains an ASIN. If it does, the shortened URL is returned. If not, an error message is returned instead.

So far, so good. To send our URL back to the user, drag the "Copy to Clipboard" action below the shell script. That's it! Basic workflow complete.

Since the workflow can take a few seconds to run, I think it's a good idea to add some notifications to the process. If you have Growl installed, you can drag the "Show Growl Notification" action to the end of your workflow. I set my title to "Amazon Affiliate Link Created" and my description to "A new affiliate link has been copied to the clipboard."

If you want an audible notificaiton, drag the "Run AppleScript" action to the end of your workflow. You can enter something as simple as "beep" to play your default system sound:

or something fancier like "say "Affiliate Link Created"" to have your Mac talk to you:

Save your service as "Create Amazon Affiliate Link", then give it a try in Safari. Navigate to a product on Amazon.com, press Cmd-L to highlight the URL, then right-click the text and select "Create Amazon Affiliate Link". Alternatively you can activate via the application menu (Safari -> Services -> Create Amazon Affiliate Link).

Lastly, a very cool feature in Snow Leopard is the ability to assign keyboard shortcuts to your custom services. To do so, open the Keyboard System Preferences pane and click on "Keyboard Shortcuts". Scroll down to "Internet" and you'll find our new service. Assign a custom keyboard shortcut and you're up and running! (You may need to restart Safari for your new keyboard shortcut to work)

If you want to download this workflow 'pre-assembled', you can download my copy here. Unzip and place it in your ~/Library/Services folder. Double-click the workflow to open it in Automator and customize it to your liking. Enjoy!

[in case you're wondering, the title of this post is from a classic XKCD comic]

Filed under: Automator

kOoLiNuS says...


Stay Up To Date On The Best Versions Of Chrome For Mac , via techcrunch.com

Article found thanks to my friend Nicola "nezmar" D'Agostino

Filed under: automator