iPad mini Cellular(SIMフリー)を転送eペリカンを使って個人輸入してみた

Verizon White & Silver 64GBモデルです。

結論から言えば、一刻も早く欲しい人は転送サービスを使った個人輸入はしないほうがいいです。時間はけっこうかかります。

しかし、金額的に少しでも安く済ませたい人は個人輸入を検討してみるのもいいのではないでしょうか。

要約

注文先 Apple Online Store US
転送サービス 転送eペリカン *1
注文日 2012年11月22日
出荷日 2012年11月30日
転送元住所到着 2012年12月3日
受領日 2012年12月9日
金額 本体代金$659 + 転送費用$54.25 + 消費税\1,500 = \61,449

注文からポートランド(転送eペリカン住所)まで

FedExはさすがに早いですね。

2012/11/22 07:54 Apple Online Store USに注文(納期2週間)
2012/11/30 23:42 AppleStoreからShipment Notificationが来る
SHANGHAI CN
2012/12/01 04:57 Picked up
2012/12/01 05:50 International shipment release - Import
2012/12/01 05:58 In transit
2012/12/01 07:41 Left FedEx origin facility
ANCHORAGE, AK
2012/12/01 20:25 International shipment release - Import
2012/12/01 21:58 Arrived at FedEx location
2012/12/02 11:19 Departed FedEx location
MEMPHIS, TN
2012/12/02 20:14 Arrived at FedEx location
2012/12/03 02:57 Departed FedEx location
OAKLAND, CA
2012/12/03 04:54 Arrived at FedEx location
2012/12/03 06:46 Departed FedEx location
PORTLAND, OR
2012/12/03 09:02 At local FedEx facility
2012/12/03 15:13 At destination sort facility
2012/12/03 16:33 At local FedEx facility
2012/12/03 17:30 On FedEx vehicle for delivery
2012/12/03 17:54 Delivered

ポートランドから自宅まで

日通は遅いですね。ポートランドでの処理も丸一日以上かかっていますし、成田に到着してからも遅いです。いったん国内配送に乗ってしまえば早いですが…。

2012/12/03 17:54 Delivered
2012/12/04 10:15 お荷物が日通倉庫に届き、商品を確認中です。
2012/12/05 07:37 お荷物が日通倉庫に届き、確認ができました。
2012/12/05 08:16 輸出書類の作成ができました。
2012/12/05 21:07 お荷物が米国の空港を出発しました。
2012/12/06 13:15 インチョン(韓国)空港に到着
2012/12/07 10:45 インチョン(韓国)空港を出発
2012/12/07 14:40 お荷物が成田空港に到着しました。
2012/12/08 11:19 上屋搬入済
2012/12/08 15:02 お荷物の通関処理が完了しました。
2012/12/08 16:29 発送店(成田営業所)を出発
2012/12/09 13:00 自宅到着

金額明細

項目 ドル
iPad mini with Wi-Fi + Cellular
for Verizon 64GB - White & Silver
US$659 ¥55,440
転送料金 US$30.00*2
燃料サーチャージ US$1.25
リチウムイオン電池商品追加費用 US$15.00
保険*3 US$8.00
転送料金合計 US$54.25 ¥4,509*4
消費税 ¥1,500
総合計 ¥61,449

たとえばEXPANSYSだと、同じモデルが12月10日現在¥68,042で、送料が¥2,800。消費税が同じ¥1500だとして、合計で¥72,342かかる計算になります。この1万円高いというのをどう考えるかでしょうね。

*1:紹介制のため http://blog.motoraji.com/1715/ Motorajiさんに紹介していただきました

*2:重さ 0.91kg 容積重量 0.57kg (10x7x3 インチ)

*3:任意です

*4:為替レート 83.12

InDesign Plugin SDK: ICommandInterceptorの実装方法

コマンドの実行に割り込めるという便利な仕組みの ICommandInterceptor だが、なんにしても情報が少なすぎる。sdksamples にも何の言及もないし、ネット上にもまともな情報がほとんどない…。

結論から言うと、StartupShutdownService と一緒に実装するとよい。

ClassDescriptionTableに以下のような感じで記述。

Class
{
	kXXXXXXStartupShutdownServiceBoss,
	kInvalidClass,
	{
		IID_ISTARTUPSHUTDOWN,  kXXXXXXStartupShutdownServiceImpl,
		IID_IK2SERVICEPROVIDER,  kCMainThreadStartupShutdownProviderImpl,
		IID_ICOMMANDINTERCEPTOR, kXXXXXXCommandInterceptorImpl, 
	}
},


CommandInterceptor自体は以下のような感じで記述。
自分の目的のコマンド以外は無視して kCmdNotHandled を返す。

class XXXXXXCommandInterceptor : public CPMUnknown<ICommandInterceptor>
{
public:
	XXXXXXCommandInterceptor(IPMUnknown* boss) : CPMUnknown<ICommandInterceptor>(boss) {}
	virtual ~XXXXXXCommandInterceptor() {}

	virtual InterceptResult InterceptProcessCommand(ICommand *cmd);
	virtual InterceptResult InterceptScheduleCommand(ICommand *cmd) { return kCmdNotHandled; }
	
	virtual InterceptResult InterceptExecuteDynamic(ICommand * cmd) { return kCmdNotHandled; }

	virtual void InstallSelf() {}
	virtual void DeinstallSelf() {}

	virtual InterceptResult InterceptExecuteImmediate(ICommand * cmd) { return kCmdNotHandled; }
};

CREATE_PMINTERFACE(XXXXXXCommandInterceptor, kXXXXXXCommandInterceptorImpl)

ICommandInterceptor::InterceptResult XXXXXXCommandInterceptor::InterceptProcessCommand(ICommand *cmd)
{
	switch (cmd->GetCreatorID()) {
		case kQuitCmdBoss:
		case kCloseAllAndQuitCmdBoss:
			// do something
			break;
	}

	return kCmdNotHandled;
}


StartupShutdownServiceのほうは以下のような感じで記述。
ここで CommandInterceptor のインストール・アンインストールをしている。
(アンインストールが正常に動いているかは不明。そもそもアンインストールは不要かも)

class XXXXXXStartupShutdownService : public CPMUnknown<IStartupShutdownService>
{
public:
	XXXXXXStartupShutdownService(IPMUnknown* boss) : CPMUnknown<IStartupShutdownService>(boss) {}
	virtual ~XXXXXXStartupShutdownService() {}

	virtual void Startup();
	virtual void Shutdown();
};

CREATE_PMINTERFACE(XXXXXXStartupShutdownService, kXXXXXXStartupShutdownServiceImpl)

void XXXXXXStartupShutdownService::Startup()
{
	InterfacePtr<ICommandInterceptor> commandInterceptor(this, UseDefaultIID());
	if (commandInterceptor) {
	InterfacePtr<ICommandProcessor> commandProcessor(GetExecutionContextSession()->QueryCommandProcessor());
		if (commandProcessor) {
			commandProcessor->InstallInterceptor(commandInterceptor);
		}
	}
}

void XXXXXXStartupShutdownService::Shutdown()
{
	InterfacePtr<ICommandInterceptor> commandInterceptor(this, UseDefaultIID());
	if (commandInterceptor) {
	InterfacePtr<ICommandProcessor> commandProcessor(GetExecutionContextSession()->QueryCommandProcessor());
		if (commandProcessor) {
			commandProcessor->DeinstallInterceptor(commandInterceptor);
		}
	}
}

InDesign Plugin SDK: メインメニューにメニューを追加する方法

http://partners.adobe.com/public/developer/indesign/sdk/explodedSDK/cs.01/training/08userinterface/08UserInterface-QandA.html

たとえば、"Test"というメニューを追加したい場合、
.frファイルのMenuDefに

0, 
"Main:Test:",   // 最後に ":" をつけるのがポイント
kEditMenuPosition + 1.0,  // Editメニューの次に置きたい場合(定数はAdobeMenuPositions.h参照)
kFalse, 

こんな感じで記述する。
常識なのかもしれないけど、なかなか分からなくて苦労した…。

InDesignのJavaScriptでE4X方式でXMLを扱うとき

つまずいたポイントを書いておきます。


・子要素を追加する
E4X記法を使うとうまくいかないので、素直にメソッドを使った方がよい)

var frame = new XML("<frame/>");
var paragraph = new XML("<paragraph/>");
frame.appendChild(paragraph);


・属性を追加する

frame.@id = "a1";

あるいは "-" が入っている属性名などなら、

frame["@frame-id"] = "a1";


・Namespaceを使う

var ns = new Namespace("aid", "http://ns.adobe.com/AdobeInDesign/4.0/");

var paragraph = new XML("<paragraph/>");
paragraph.addNamespace(ns);
paragraph.@pstyle = "本文";
paragraph.@pstyle.setNamespace(ns);

base64のデコードでBIO_readが失敗するとき

base64のデコードでBIO_readが失敗するときは、
BIO_set_flags(base64, BIO_FLAGS_BASE64_NO_NL);
するとよい。

	static CFDataRef DecodeBase64(CFStringRef srcRef)
	{
		if (srcRef == NULL)
			return NULL;
		
		CFIndex length = CFStringGetLength(srcRef);
		CFIndex bytesSize;		
		CFIndex convertedCharacterLength = CFStringGetBytes(srcRef, CFRangeMake(0, length), kCFStringEncodingASCII, 0, false, NULL, 0, &bytesSize);
		if (convertedCharacterLength != length)
			return NULL;
		if (bytesSize <= 0)
			return NULL;
		
		UInt8 *srcBytes = (UInt8 *)malloc(bytesSize);
		CFStringGetBytes(srcRef, CFRangeMake(0, length), kCFStringEncodingASCII, 0, false, srcBytes, bytesSize, NULL);
		
		BIO *base64 = BIO_new(BIO_f_base64());

		BIO_set_flags(base64, BIO_FLAGS_BASE64_NO_NL);
		BIO *biomem = BIO_new_mem_buf(srcBytes, bytesSize);
		BIO *biochain = BIO_push(base64, biomem);
		
		CFMutableDataRef dataRef = CFDataCreateMutable(kCFAllocatorDefault, 0);

		UInt8 buffer[1024];
		CFIndex readLen;
		while ( (readLen = BIO_read(biochain, buffer, 1024) ) > 0)
		{
			CFDataAppendBytes(dataRef, buffer, readLen);
		}

		BIO_free_all(biochain);
		free(srcBytes);

		return dataRef;
	}