趣旨

MACのautomatorは、シェルスクリプトやAppleScript?やFinderの制御などをおこなうものらしいが、

とっかかりが、難しそうなので、その辺の情報収集をめもします。 

目次

チュートリアル

アプリケーションを実行する相対パスに関する注意点など

http://blog.goo.ne.jp/66cri/e/48c3cf8b85645d3ea4c35f10d6eb46a0

フォルダ内のJPGを一カ所に集めるチュートリアル(英語)

http://www.metacafe.com/watch/6791223/save_tons_of_time_using_automator_for_mac_video_tutorial/

チュートリアルをみて思ったAutomatorの特徴は、

となると、XCodeでアプリを作るときに、Automatorから制御できるためのライブラリがAppleのサイトに記載方法が乗っている可能性があるのではないでしょうか?

下記の質問ページを見つけました。

http://stackoverflow.com/questions/5971840/can-i-use-an-application-as-a-library-mac-objective-c

気になるObjectiveCのクラスがリストアップしてあります。

基本的な関連するObjectiveCのクラス

Automator対応アプリを作るにあたって、プロジェクトは主に3種類あるみたいです。

  1. シェルをベースとしたプロジェクト
  2. ActionScript?をベース
  3. ObjectiveCをベース

ん? KWDocumentクラスとKWRegistrationManager?クラスをを使った文章複製のサンプルが記載されているのかな?

KWDuplicateObjectsToDocument?.h

#import <Cocoa/Cocoa.h>
#import <Automator/AMBundleAction.h>

@interface KWDuplicateObjectsToDocument : AMBundleAction {

}

- (id)runWithInput:(id)input fromAction:(AMAction *)anAction
                                  error:(NSDictionary **)errorInfo;

@end

KWDuplicateObjectsToDocument?.m

#import "KWDuplicateObjectsToDocument.h"
#import "KWDocument.h"
#import "KWRegistrationManager.h"


@implementation KWDuplicateObjectsToDocument

- (id)runWithInput:(id)input fromAction:(AMAction *)anAction
         error:(NSDictionary **)errorInfo {
     if (![[KWRegistrationManager defaultManager] isRegistered]) {
         return nil;
     }

   // eventually you'll call 
   // duplicateObjects:toDocument:

     return input;
}

@end

で、これを参考にすれば、apple scriptとか、ObjectiveCで制御可能なアプリを作ることができるみたいだ。

この回答を書いたNSGodさんすごいな。

どれどれ、Macのフォント関連のシェアウェア作者さんのようですね。

http://www.markdouma.com/fontfinagler/

やっぱ、アプリ作る人すごいなー。

Automatorを使用してTerminal.appでSSH接続を自動化する

http://ameblo.jp/welx/entry-10994763341.html

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2012-06-13 (水) 18:21:29 (4326d)