#http://www.ac-promenade.net/text/windowsmobile/ #Scripted by AC-Promenade http://www.ac-promenade.net/ #SHARPカメラ・サポート #ShCamera_Sp.mscr #"カメラ"のサイズ等各設定を登録し事前選択起動できるMortScript。 #設定により撮影後、自動で任意の画像ビューア等も起動できます。 #●使用方法概要 #・予め本mscrにプリセット設定を記述しておきます。(詳細は後述) #・本mscrを実行すると、前回設定とプリセットリストを表示します。 #・プリセットリストは数字キーでの選択にも対応しています。 #・選択決定すると、そのプリセット設定状態でカメラが起動します。 #・設定によって[es]Silencer等を起動させることもできます。 #・本mscrに引数"Set=番号"を渡せば直接起動することもできます。※ #・設定によって撮影終了後にビューア等を起動することもできます。 #●使用の準備 #強制ではありませんが、本mscrのショートカットを #プログラムグループに登録し、スタート>設定>個人用>ボタンで #"カメラ"の代わりに本mscrを設定しておくとよいかと思います。 #●動作確認デバイス #Advanced/W-ZERO3[es], WILLCOM 03 #他ZERO3系デバイスのカメラアプリの仕様は不明です。 #SHARPのカメラが対象なので、その他機種は動かないと思いますが、 #参照レジストリ値の改変だけで利用出来るかもしれません。 #もし他のWindows Mobile機でも動いたらご報告頂けると嬉しいです。 #●必要環境 #・MortScript4.1以上(それ以下でも動くかも)、mscrの関連付け。 # http://www.sto-helit.de/ (PCサイト) #●補足事項 #・[es]Silencer (カメラのシャッター音を無音化) # http://dislife.com/software/#es_silencer #※引数は、[\Program Files\MortScript\MortScript.exe]に対して #["\Program Files\MortScript\ShCamera_Sp.mscr" Set=番号]を #引数として渡すことに注意してください。(特に""の有無等。) #番号の部分には呼び出すプリセット番号の数字を記述して下さい。 #本mscrのショートカットに、アイコンを利用したい場合は、 #ショートカットファイルのリンク先に、直接続けて #?\Windows\ShCamera.exe,-128と追記して下さい。 #(インストールパスが異なる場合は、記述を修正して下さい。) #アンインストールの際は、本mscrを削除するだけで大丈夫です。 #レジストリの追加、別ファイルの作成等は行っていません。 #本mscrによって生じる不利益に当方は関与しません。 #設定変数値を除く内容に改ざんがない限り、再配布は自由です。 #内容に変更を加えた際の再配布は、必ずその変更前と変更後の #明記を、本文中にて行ってあれば構いません。 #--------------------------------------------------------------- #以下環境設定 #(書き換えの際、文字コードS-JISが変換されないよう御注意下さい。) #■カメラを起動するプリセット設定を登録。(複数可)※詳細は後述 SetTitle[1]="カメラ (前回設定でビューア起動無し)" SetTitle[2]="バーコード リーダ (QRコード読み取り)" CameraCmd[2]="\Windows\BarCodeReader.exe" SetTitle[3]="タテ写メ撮り (日中)" StoreAngle[3]="縦長" Condition[3]="シーン標準" MobileMode[3]="ズームOFF" StillSize[3]="撮影QVGA" StillQuality[3]="高画質" StillMode[3]="タイマーOFF" Burst[3]="連射OFF" VideoSize[3]="録画QQVGA" AudioEnable[3]="録画音声ON" VideoTime[3]="録画15秒" ViewerCmd[3]="\Windows\pimg.exe" ViewerArg[3]="Auto" SetTitle[4]="ヨコ本気撮り (日中)" StoreAngle[4]="横長" Condition[4]="シーン標準" MobileMode[4]="ズームOFF" StillSize[4]="撮影SXGA" StillQuality[4]="高画質" StillMode[4]="タイマーOFF" Burst[4]="連射OFF" VideoSize[4]="録画QVGA" AudioEnable[4]="録画音声ON" VideoTime[4]="録画30秒" ViewerCmd[4]="\Windows\pimg.exe" ViewerArg[4]="Auto" #※以下、詳細を説明します。 #SetTitleを除く他の項目は省略が可能です。 #SetTitleの[]内番号は1から連番で並んでいる必要があります。 # SetTitle[]= プリセットの任意リストタイトル名 (指定必須) # CameraCmd[]= 必要であれば[es]Silencer等の実行パスを指定 (省略時は"カメラ"を起動します) # CameraArg[]= 必要であればその引数 ("カメラ"に引数を渡す場合CameraCmdも指定が必要です) # ViewerCmd[]= 必要であれば撮影終了後に起動するアプリ(ビュアー等)パスを指定 # ViewerArg[]= 必要であればその引数 (画像とビデオかXnViewなら"AUTO"が可能※) #下記の項目は、レジストリ値の代わりにキーワード指定も可能です。 #例:Store[1]=0と、Store[1]="本体メモリ"は、同じ指定となります。 #=後の文字やパス指定の場合は、""内に記述して下さい。 #レジストリ値による指定の場合は、=後の""を省略しても構いません。 # Store[]= 保存先 0=本体メモリ 1=microSDカード # StoreAngle[]= 保存する向き 0=縦長 1=横長 # Condition[]= 撮影シーン 0=標準 1=風景 2=人物 3=パーティ 4=夜景 5=白熱灯 6=蛍光灯 # Brightness[]= 明るさ 0=+3 1=+2 2=+1 3=+0 4=-1 5=-2 6=-3 # MobileMode[]= 2倍ズーム 0=OFF 1=ON # StillSize[]= 撮影サイズ 0=QVGA(320×240) 1=VGA(640×480) 2=SXGA(1280×1024) 3=UXGA(1600×1200) #StillQuality[]= 画質 0=低画質 1=標準 2=高画質 # StillMode[]= タイマー(5秒) 0=OFF 1=ON (連射と併用は出来ません。) # Burst[]= 連射(5秒) 0=OFF 1=ON (タイマーと併用は出来ません。) # VideoSize[]= 録画サイズ 0=QVGA(320×240) 1=QQVGA(160×120) # AudioEnable[]= オーディオ録音 0=OFF 1=ON # VideoTime[]= 録画制限時間 0=15秒 1=30秒 2=制限なし #上記の項目以外にも、 #"HKEY_CURRENT_USER\Software\Sharp\Camera"と、 #"HKEY_CURRENT_USER\Software\Microsoft\Pictures\Camera\USER"に #既存のレジストリキーがあれば、プリセット指定が可能です。 #レジストリキー[プリセット番号]=値 という書式になっています。 #参考までに、ビュアーの起動指定パスは以下の通りです。 #"画像とビデオ"のパス、"\Windows\pimg.exe" #"画像とビデオ"の引数本体メモリ、"-directory:\My Documents\マイ ピクチャ" #"画像とビデオ"の引数SDカード、"-directory:\microSDカード\DCIM" #XnView Pocketのパス、"\Program Files\XnView Pocket\xnpocket.exe" #XnView Pocketの引数本体メモリ、"\My Documents\マイ ピクチャ\" #XnView Pocketの引数SDカード、"\microSDカード\DCIM\" #※本mscrでは"画像とビデオ","XnView"の場合のみ、 #引数"AUTO"を指定することで、本体とカードを自動的に判断します。 #--------------------------------------------------------------- #バージョン履歴 #1.04 内部処理を一部簡略化。 #1.03 録画音声のオンオフが効いていなかったのを修正。 #1.02 前回起動内容表示の画面の向きが縦横逆だったのを修正。 #1.01 WILLCOM 03にて引数が無いときにエラーが出るバグを修正。 #1.00 公開。 #--------------------------------------------------------------- #Main Script #■PPC制限 If(MortScriptType() ne "PPC") message("This script is PPC only.") Exit EndIf #LastDataSt PreSetNumber=1 #LastDataEd SDMFolder=RegRead ("HKLM","System\StorageManager\Profiles\SDMemory","Folder") RegStore="RegRead (""HKCU"",""Software\Sharp\Camera"",""Store"")" RegStoreAngle="RegRead (""HKCU"",""Software\Sharp\Camera"",""StoreAngle"")" RegCondition="RegRead (""HKCU"",""Software\Sharp\Camera"",""Condition"")" RegBrightness="RegRead (""HKCU"",""Software\Microsoft\Pictures\Camera\USER"",""Brightness"")" RegMobileMode="RegRead (""HKCU"",""Software\Sharp\Camera"",""MobileMode"")" RegStillSize="RegRead (""HKCU"",""Software\Sharp\Camera"",""StillSize"")" RegStillQuality="RegRead (""HKCU"",""Software\Sharp\Camera"",""StillQuality"")" RegStillMode="RegRead (""HKCU"",""Software\Sharp\Camera"",""StillMode"")" RegBurst="RegRead (""HKCU"",""Software\Sharp\Camera"",""Burst"")" RegVideoSize="RegRead (""HKCU"",""Software\Sharp\Camera"",""VideoSize"")" RegAudioEnable="RegRead (""HKCU"",""Software\Sharp\Camera"",""AudioEnable"")" RegVideoTime="RegRead (""HKCU"",""Software\Sharp\Camera"",""VideoTime"")" #■カメラが起動していたら終了 If (ProcExists ("ShCamera.exe")) Close ("カメラアプリ ") Sleep (300) EndIf #■ごういんな引数受け取りチェック ErrorLevel ("Off") If ( (Set>=1) and (Not IsEmpty (SetTitle[Set])) ) ErrorLevel ("error") SetNumber=Set Else #■ダイアログリスト、ページ&インデックスナンバー割り当て ErrorLevel ("error") DPg=0 DNm=1 ForEach FEBox in array ("SetTitle") If(DNm<10) DlgList[DPg][DNm]=DNm&". "&FEBox DNm=DNm+1 ElseIf(DNm=10) DlgList[DPg][DNm]="0. "&FEBox DNm=DNm+1 Else If (DPg>=1) DlgList[DPg][DNm]="*. Back <<" DNm=DNm+1 EndIf DlgList[DPg][DNm]="#. Next >>" DPg=DPg+1 DNm=1 DlgList[DPg][DNm]="1. "&FEBox DNm=DNm+1 EndIf EndForEach If (DPg>=1) DlgList[DPg][DNm]="*. Back <<" EndIf #■前回設定の表示準備 v=Eval (RegStore) If (v=1) PreStore="カード" Else PreStore="本体" EndIf v=Eval (RegStoreAngle) If (v=1) PreStoreAngle="横長" Else PreStoreAngle="縦長" EndIf v=Eval (RegCondition) If (v=1) PreCondition="風景" ElseIf (v=2) PreCondition="人物" ElseIf (v=3) PreCondition="パーティ" ElseIf (v=4) PreCondition="夜景" ElseIf (v=5) PreCondition="白熱灯" ElseIf (v=6) PreCondition="蛍光灯" Else PreCondition="標準" EndIf v=Eval (RegBrightness) If (v=1) PreBrightness="+2" ElseIf (v=2) PreBrightness="+1" ElseIf (v=3) PreBrightness="+0" ElseIf (v=4) PreBrightness="-1" ElseIf (v=5) PreBrightness="-2" ElseIf (v=6) PreBrightness="-3" Else PreBrightness="+3" EndIf v=Eval (RegMobileMode) If (v=1) PreMobileMode="ズームON" Else PreMobileMode="ズームOFF" EndIf v=Eval (RegStillSize) If (v=1) PreStillSize="VGA" ElseIf (v=2) PreStillSize="SXGA" ElseIf (v=3) PreStillSize="UXGA" Else PreStillSize="QVGA" EndIf v=Eval (RegStillQuality) If (v=1) PreStillQuality="標準" ElseIf (v=2) PreStillQuality="高画質" Else PreStillQuality="低画質" EndIf v=Eval (RegStillMode) If (v=1) PreStillBurst="St5秒" Else PreStillBurst="OFF" EndIf v=Eval (RegBurst) If (v=1) PreStillBurst="連射5秒" EndIf v=Eval (RegVideoSize) If (v=1) PreVideoSize="QQVGA" Else PreVideoSize="QVGA" EndIf v=Eval (RegAudioEnable) If (v=1) PreAudioEnable="録音" Else PreAudioEnable="無音" EndIf v=Eval (RegVideoTime) If (v=1) PreVideoTime="30秒" ElseIf (v=2) PreVideoTime="無制限" Else PreVideoTime="15秒" EndIf DlgPrmPreMode="LastSet^TAB^共通: "&PreStore&" "&PreStoreAngle&" "&PreCondition&PreBrightness\ &"^NL^-^TAB^撮影: "&PreStillSize&" "&PreStillQuality&" "&PreStillBurst\ &"^NL^-^TAB^録画: "&PreVideoSize&" "&PreAudioEnable&" "&PreVideoTime #共通: カード 縦長 パーティ+0 ズームOFF #撮影: QVGA 高画質 タイマーOFF 連射OFF #録画: QQVGA 録音OFF 録画無制限 #■ダイアログ選択画面(-1は10をページアップしない措置) DefNum=(PreSetNumber-1) mod 10 + 1 DPg=((PreSetNumber-1) - (PreSetNumber-1) mod 10) / 10 DBack=0 DNext=0 DlgTitle="ShCamera_Sp / by AC-Promenade" DlgPrmTitle=DlgPrmPreMode DlgTime=0 If (MaxIndex (SetTitle)>10) ListMax=" / "&MaxIndex (SetTitle) Else ListMax="" EndIf Ok=0 While (Ok=0) If (DPg=MaxIndex (DlgList)) ListEnd=MaxIndex (SetTitle) If (DBack+DNext>=1) DefNum=MaxIndex (DlgList[DPg]) EndIf Else ListEnd=(DPg+1)*10 If (DBack=1) DefNum=11 ElseIf (DNext=1) DefNum=12 EndIf EndIf DlgPrompt=(DPg&1)*1&"-"&ListEnd&ListMax&" User preset list^NL^"&DlgPrmTitle ChoiceDefault (DlgTitle,DlgPrompt,DefNum,DlgTime,"DlgList[DPg]") Case (0) Exit Case (1) DNm=1 Case (2) DNm=2 Case (3) DNm=3 Case (4) DNm=4 Case (5) DNm=5 Case (6) DNm=6 Case (7) DNm=7 Case (8) DNm=8 Case (9) DNm=9 Case (10) DNm=10 Case (11) DNm=11 Case (12) DNm=12 EndChoice If (DlgList[DPg][DNm] eq "*. Back <<") DPg=DPg-1 DBack=1 DNext=0 ElseIf (DlgList[DPg][DNm] eq "#. Next >>") DPg=DPg+1 DBack=0 DNext=1 Else SetNumber=DPg*10 + DNm Ok=1 EndIf EndWhile #■前回不一致なら、今回選択項目番号保存 If (SetNumber<>PreSetNumber) Call ("LastDataSave") EndIf EndIf #■変更値の配列振り分け(SHARP,Microsoft)、実変数名に置き換え(これ以後SetNumber不要) CameraCmd=CameraCmd[SetNumber] CameraArg=CameraArg[SetNumber] ViewerCmd=ViewerCmd[SetNumber] ViewerArg=ViewerArg[SetNumber] #以下、"#"外すと、本来レジストリが存在セーフ機能可動。 #sep="," #word="" i=1 ForEach FEBox, data in regValues ("HKCU","Software\Sharp\Camera") If ([FEBox&"["&SetNumber&"]"] ne "") SharpSetting[i]=FEBox [FEBox]=[FEBox&"["&SetNumber&"]"] # word=word&FEBox&sep i=i+1 EndIf EndForEach #本来レジストリが存在してるはずなのに、存在しない故指定失敗した場合の処置 #ForEach FEBox in values (\ # "Store","StoreAngle","Condition","MobileMode",\ # "StillSize","StillQuality","StillMode","Burst",\ # "VideoSize","AudioEnable","VideoTime") # If (Not Find(word,FEBox&sep)) # If ([FEBox&"["&SetNumber&"]"] ne "") # SharpSetting[i]=FEBox # [FEBox]=[FEBox&"["&SetNumber&"]"] # i=i+1 # EndIf # EndIf #EndForEach #word="" i=1 ForEach FEBox, data in regValues ("HKCU","Software\Microsoft\Pictures\Camera\USER") If ([FEBox&"["&SetNumber&"]"] ne "") MSoftSetting[i]=FEBox [FEBox]=[FEBox&"["&SetNumber&"]"] # word=word&FEBox&sep i=i+1 EndIf EndForEach #本来レジストリが存在してるはずなのに、存在しない故指定失敗した場合の処置(単品だけど) #ForEach FEBox in values ("Brightness") # If ([FEBox&"["&SetNumber&"]"] ne "") # MSoftSetting[i]=FEBox # [FEBox]=[FEBox&"["&SetNumber&"]"] # i=i+1 # EndIf #EndForEach #■文字列変換プロセス ForEach FEBox in array ("SharpSetting") Switch (FEBox) Case ("Store") If ( Not ( (Length ([FEBox])=1)\ and (([FEBox]=1) or (Find ([FEBox],"0"))) ) ) If ( (Find ([FEBox],"カ")) or (Find ([FEBox],"カ"))\ or (Find ([FEBox],"S")) or (Find ([FEBox],"S"))\ or (Find ([FEBox],"s")) or (Find ([FEBox],"s"))\ or (Find ([FEBox],"C")) or (Find ([FEBox],"C"))\ or (Find ([FEBox],"c")) or (Find ([FEBox],"c")) ) [FEBox]=1 Else [FEBox]=0 EndIf EndIf Case ("StoreAngle") If ( Not ( (Length ([FEBox])=1)\ and (([FEBox]=1) or (Find ([FEBox],"0"))) ) ) If ( (Find ([FEBox],"横")) or (Find ([FEBox],"よ"))\ or (Find ([FEBox],"ヨ")) or (Find ([FEBox],"ヨ")) ) [FEBox]=1 Else [FEBox]=0 EndIf EndIf Case ("Condition") If ( Not ( (Length ([FEBox])=1)\ and ((([FEBox]<=6) and ([FEBox]>=1)) or (Find ([FEBox],"0"))) ) ) If (Find ([FEBox],"風")) [FEBox]=1 ElseIf (Find ([FEBox],"人")) [FEBox]=2 ElseIf ( (Find ([FEBox],"パ")) or (Find ([FEBox],"パ")) ) [FEBox]=3 ElseIf (Find ([FEBox],"夜")) [FEBox]=4 ElseIf (Find ([FEBox],"白")) [FEBox]=5 ElseIf (Find ([FEBox],"蛍")) [FEBox]=6 Else [FEBox]=0 EndIf EndIf Case ("MobileMode") If ( Not ( (Length ([FEBox])=1)\ and (([FEBox]=1) or (Find ([FEBox],"0"))) ) ) If ( (Find ([FEBox],"N")) or (Find ([FEBox],"N"))\ or (Find ([FEBox],"n")) or (Find ([FEBox],"n"))\ or (Find ([FEBox],"2")) or (Find ([FEBox],"2"))\ or (Find ([FEBox],"倍")) ) [FEBox]=1 Else [FEBox]=0 EndIf EndIf Case ("StillSize") If ( Not ( (Length ([FEBox])=1)\ and ((([FEBox]<=3) and ([FEBox]>=1)) or (Find ([FEBox],"0"))) ) ) If ( ([FEBox]=1920000)\ or ( ([FEBox]<=1600) and ([FEBox]<>1280) and ([FEBox]>=1200) )\ or (Find ([FEBox],"U")) or (Find ([FEBox],"U"))\ or (Find ([FEBox],"u")) or (Find ([FEBox],"u")) ) [FEBox]=3 ElseIf ( ([FEBox]=1310720)\ or ( ([FEBox]<=1280) and ([FEBox]>=1024) )\ or (Find ([FEBox],"S")) or (Find ([FEBox],"S"))\ or (Find ([FEBox],"s")) or (Find ([FEBox],"s")) ) [FEBox]=2 ElseIf ( ([FEBox]=307200)\ or ( ([FEBox]<=640) and ([FEBox]>=480) )\ or ( (Not Find ([FEBox],"Q")) and (Not Find ([FEBox],"Q"))\ and (Not Find ([FEBox],"q")) and (Not Find ([FEBox],"q")) ) ) [FEBox]=1 Else [FEBox]=0 EndIf EndIf Case ("StillQuality") If ( Not ( (Length ([FEBox])=1)\ and ((([FEBox]<=2) and ([FEBox]>=1)) or (Find ([FEBox],"0"))) ) ) If ( (Find ([FEBox],"高"))\ or (Find ([FEBox],"H")) or (Find ([FEBox],"H"))\ or (Find ([FEBox],"h")) or (Find ([FEBox],"h")) ) [FEBox]=2 ElseIf ( (Find ([FEBox],"準")) or (Find ([FEBox],"通"))\ or (Find ([FEBox],"M")) or (Find ([FEBox],"M"))\ or (Find ([FEBox],"m")) or (Find ([FEBox],"m")) ) [FEBox]=1 Else [FEBox]=0 EndIf EndIf Case ("StillMode") If ( Not ( (Length ([FEBox])=1)\ and (([FEBox]=1) or (Find ([FEBox],"0"))) ) ) If ( (Find ([FEBox],"N")) or (Find ([FEBox],"N"))\ or (Find ([FEBox],"n")) or (Find ([FEBox],"n"))\ or (Find ([FEBox],"5")) or (Find ([FEBox],"5")) ) [FEBox]=1 Else [FEBox]=0 EndIf EndIf Case ("Burst") If (StillMode=0) If ( Not ( (Length ([FEBox])=1)\ and (([FEBox]=1) or (Find ([FEBox],"0"))) ) ) If ( (Find ([FEBox],"N")) or (Find ([FEBox],"N"))\ or (Find ([FEBox],"n")) or (Find ([FEBox],"n"))\ or (Find ([FEBox],"5")) or (Find ([FEBox],"5")) ) [FEBox]=1 Else [FEBox]=0 EndIf EndIf EndIf Case ("VideoSize") If ( Not ( (Length ([FEBox])=1)\ and (([FEBox]=1) or (Find ([FEBox],"0"))) ) ) If ( ([FEBox]=19200)\ or ( ([FEBox]<=160) and ([FEBox]>=120) )\ or (Find ([FEBox],"QQ")) or (Find ([FEBox],"QQ"))\ or (Find ([FEBox],"qq")) or (Find ([FEBox],"qq"))\ or (Find ([FEBox],"Qq")) or (Find ([FEBox],"Qq"))\ or (Find ([FEBox],"qQ")) or (Find ([FEBox],"qQ"))\ or (Find ([FEBox],"Qq")) or (Find ([FEBox],"Qq"))\ or (Find ([FEBox],"qQ")) or (Find ([FEBox],"qQ")) ) [FEBox]=1 Else [FEBox]=0 EndIf EndIf Case ("AudioEnable") If ( Not ( (Length ([FEBox])=1)\ and (([FEBox]=1) or (Find ([FEBox],"0"))) ) ) If ( (Find ([FEBox],"N")) or (Find ([FEBox],"N"))\ or (Find ([FEBox],"n")) or (Find ([FEBox],"n")) ) [FEBox]=1 Else [FEBox]=0 EndIf EndIf Case ("VideoTime") If ( Not ( (Length ([FEBox])=1)\ and ((([FEBox]<=2) and ([FEBox]>=1)) or (Find ([FEBox],"0"))) ) ) If ( (Not Find ([FEBox],"1")) and (Not Find ([FEBox],"1"))\ and (Not Find ([FEBox],"3")) and (Not Find ([FEBox],"3"))\ and (Not Find ([FEBox],"5")) and (Not Find ([FEBox],"5")) ) [FEBox]=2 ElseIf ( (Find ([FEBox],"3")) or (Find ([FEBox],"3")) ) [FEBox]=1 Else [FEBox]=0 EndIf EndIf EndSwitch EndForEach ForEach FEBox in array ("MSoftSetting") Switch (FEBox) Case ("Brightness") If (Length ([FEBox])>=2) If ( (Find ([FEBox],"-")) or (Find ([FEBox],"−"))\ or (Find ([FEBox],"ー")) or (Find ([FEBox],"ー")) ) If ( (Find ([FEBox],"3")) or (Find ([FEBox],"3")) ) [FEBox]=6 ElseIf ( (Find ([FEBox],"2")) or (Find ([FEBox],"2")) ) [FEBox]=5 Else [FEBox]=4 EndIf ElseIf ( (Find ([FEBox],"1")) or (Find ([FEBox],"1")) ) [FEBox]=2 ElseIf ( (Find ([FEBox],"2")) or (Find ([FEBox],"2")) ) [FEBox]=1 ElseIf ( (Find ([FEBox],"3")) or (Find ([FEBox],"3")) ) [FEBox]=0 Else [FEBox]=3 EndIf ElseIf ( ([FEBox]>6) or ([FEBox]<0)\ or (([FEBox]=0) and (Not Find ([FEBox],"0"))) ) [FEBox]=3 EndIf EndSwitch EndForEach #■レジストリ値反映 ForEach FEBox in array ("SharpSetting") RegWriteDWord ("HKCU","Software\Sharp\Camera",FEBox,[FEBox]) EndForEach ForEach FEBox in array ("MSoftSetting") RegWriteDWord ("HKCU","Software\Microsoft\Pictures\Camera\USER",FEBox,[FEBox]) EndForEach #■事前ディレクトリ内容チェック Call ("DCIMDirChk") PreDevFiles=DevFiles PreMSDFiles=MSDFiles #■準備完了、アプリケーション実行 Sleep (300) If (CameraCmd eq "") RunWait ("\Windows\ShCamera.exe") ElseIf (CameraArg eq "") RunWait (CameraCmd) Else RunWait (CameraCmd,CameraArg) EndIf #■事後ディレクトリ内容チェック、変化時ビュアーアプリ起動 If (ViewerCmd ne "") Call ("DCIMDirChk") If ( (PreDevFiles<>DevFiles) or (PreMSDFiles<>MSDFiles) ) #■引数"AUTO"判定 ViewerArgLow=ToLower (ViewerArg) If (ViewerArgLow eq "auto") LastStore=Eval (RegStore) ViewerCmdLow=ToLower (ViewerCmd) If (Find (ViewerCmdLow,"pimg.exe")) If (LastStore=0) ViewerArg="-directory:\My Documents\マイ ピクチャ" Else ViewerArg="-directory:\"&SDMFolder&"\DCIM" EndIf ElseIf (Find (ViewerCmdLow,"xnpocket.exe")) If (LastStore=0) ViewerArg="\My Documents\マイ ピクチャ\" Else ViewerArg="\"&SDMFolder&"\DCIM\" EndIf EndIf EndIf If (ViewerArg eq "") Run (ViewerCmd) Else Run (ViewerCmd,ViewerArg) EndIf EndIf EndIf #--------------------------------------------------------------- #Sub Script #■Call ("LastDataSave") 本mscrに前回環境を保存 Sub LastDataSave ThisFile=SystemPath ("ScriptName")&SystemPath ("ScriptExt") ThisFilePath=SystemPath ("ScriptPath")\ThisFile If (FileExists (ThisFilePath)) ThisFileText=ReadFile (ThisFilePath,0,"jis") PostFileText=Part (ThisFileText,"^NL^#LastDataSt",1,0)\ &"^NL^#LastDataSt"\ &"^NL^PreSetNumber="&SetNumber\ &"^NL^#LastDataEd"\ &Part (ThisFileText,"^NL^#LastDataEd",-1,0) WriteFile (ThisFilePath,PostFileText,0,"jis") EndIf EndSub #■Call ("DCIMDirChk") カメラ保存ディレクトリ内容チェック Sub DCIMDirChk DevFiles=0 ForEach FEBox in files ("\My Documents\マイ ピクチャ\*.*") DevFiles=DevFiles+1 EndForEach MSDFiles=0 ForEach FEBox in files (SDMFolder\"\DCIM\*.*") MSDFiles=MSDFiles+1 EndForEach EndSub