// mk_workspace2.uws(Inkscape) // 左クリックしたウィンドウのワークスペース(ウィンドウの位置・大きさ)を // uwsファイルとしてデスクトップに書き出し、そのワークスペースでInkscapeを起動できる // ショートカット(のようなもの)を生成します(ファイル名 workspace1.uws) // デスクトップに書き出されたworkspace1.uwsを実行すると、Inkscapeが記録時の位置で起動 // し、記録時にダイアログをクリックしていれば同時にダイアログ・パレットも表示します // (作成されたworkspace1.uwsは別の場所に移動してリネームしてもokです)。 // workspace1.uwsが既にデスクトップに存在した場合、メッセージで「はい」を押すと内容が破棄 // されて上書きされます。用途別にファイル名をリネームされる事をおすすめします。 // 一応重複チェックを行いますが、window1 -> window2 -> window1といった形で別の行を跨いで // 同じウィンドウが登録されても、重複した行は削除されないのでご注意ください。 // class name = "gdkWindowToplevel" 以外のウィンドウをクリックしても記録されません。 Inkscape=GETID(" - Inkscape","gdkWindowToplevel",0.1) ifb Inkscape<0 MsgBox("Inkscapeが起動してません",Btn_abort) Exit endif public caption if MsgBox("OKボタンを押した後、ワークスペースを保存するウィンドウのタイトルバーを<#cr>"+_ "1回ずつクリックしてください。<#cr>[Tab]キーを押すとデスクトップにworkspace1.uwsを作成します。",_ Btn_ok or Btn_abort)=Btn_abort then Exit bs="\" mk_workspace=Copy(GET_APPDATA_DIR,1,pos(bs,GET_APPDATA_DIR,-1))+"デスクトップ\workspace1.uws" ifb Fopen(mk_workspace,F_exists)=1 ifb MsgBox("既存の"+mk_workspace+"が存在します。上書きしますか?<#cr><#cr>",Btn_yes or Btn_abort,,Btn_abort)=Btn_abort Exit endif endif fid=Fopen(mk_workspace,F_write) Fput(fid,"Inkscape=exec(<#dbl>"+Status(Inkscape,St_path)+"<#dbl>)<#cr>repeat<#cr> Sleep(0.5)<#cr>"+_ "until Status(Inkscape,St_visible)<#cr>ACW(GETID(<#dbl> - Inkscape<#dbl>,<#dbl>gdkWindowToplevel<#dbl>),"+_ Status(Inkscape,St_x)+","+Status(Inkscape,St_y)+","+Status(Inkscape,St_width)+","+Status(Inkscape,St_height)+",200)") while true Sleep(0.2) ifb Getkeystate(VK_LBUTTON) w_class=Status(GetID(Get_active_win),St_class) if w_class<>"gdkWindowToplevel" then Continue w_name=Status(GetID(Get_active_win),St_title) if pos(" - ",w_name)>1 then w_name=Copy(w_name,pos(" - ",w_name,-1),(val(length(w_name)))-(val(pos(" - ",w_name,-1))-1)) if pos(": XMLエディタ(X) (Shift+Ctrl+X)",w_name)>1 then w_name=": XMLエディタ(X) (Shift+Ctrl+X)" w_name="<#dbl>"+w_name+"<#dbl>," w_class="<#dbl>"+w_class+"<#dbl>)," w_ofs_x=Status(GetID(Get_active_win),St_x)+"," w_ofs_y=Status(GetID(Get_active_win),St_y)+"," w_width=Status(GetID(Get_active_win),St_width)+"," w_height=Status(GetID(Get_active_win),St_height)+",200)" Fput(fid,"ACW(GETID("+w_name+w_class+w_ofs_x+w_ofs_y+w_width+w_height) Sleep(0.2) elseif Getkeystate(VK_TAB) Fclose(fid) Sleep(0.2) break endif wend fid=Fopen(mk_workspace,F_read or F_write) lines=5 while True Sleep(0.2) if Fget(fid,lines)="" then break ifb Fget(fid,lines)<>Fget(fid,val(lines)+1) lines=val(lines)+1 Continue else Fdelline(fid,val(lines)+1) Sleep(0.2) endif wend Fclose(fid) Sleep(0.5) fid=Fopen(mk_workspace,F_read or F_write) lines=5 for i=0 to Fget(fid,F_linecount)-1 Sleep(0.2) if Fget(fid,lines)="" then break caption=Fget(fid,lines) Fput(fid,dialogs()+caption,lines) lines=val(lines)+1 next Fput(fid,"CtrlWin(Inkscape,Acivate)<#cr>KBD(VK_5,0,40)") Fclose(fid) Sleep(3) MsgBox("done") function dialogs() ifb pos("フィル",caption)>1 Result=_ "SCKEY(Inkscape,VK_SHIFT,VK_CTRL,F)<#cr>KBD(VK_SHIFT,2,40)<#cr>KBD(VK_CTRL,2,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "Fill=GETID(<#dbl>フィル/ストローク(F) (Shift+Ctrl+F)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,-1)<#cr>" endif ifb pos("ドキュメント",caption)>1 Result=_ "SCKEY(Inkscape,VK_SHIFT,VK_CTRL,D)<#cr>KBD(VK_SHIFT,2,40)<#cr>KBD(VK_CTRL,2,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "D_Property=GETID(<#dbl>ドキュメントの設定(D) (Shift+Ctrl+D)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,-1)<#cr>" endif ifb pos("オブジェクト",caption)>1 Result=_ "SCKEY(Inkscape,VK_SHIFT,VK_CTRL,O)<#cr>KBD(VK_SHIFT,2,40)<#cr>KBD(VK_CTRL,2,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "O_Property=GETID(<#dbl>オブジェクトのプロパティ(O) (Shift+Ctrl+O)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,-1)<#cr>" endif ifb pos("スウォッチ",caption)>1 Result=_ "SCKEY(Inkscape,VK_SHIFT,VK_CTRL,W)<#cr>KBD(VK_SHIFT,2,40)<#cr>KBD(VK_CTRL,2,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "Swatch=GETID(<#dbl>スウォッチ(W) (Shift+Ctrl+W)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,-1)<#cr>" endif ifb pos("レイヤー",caption)>1 Result=_ "SCKEY(Inkscape,VK_SHIFT,VK_CTRL,L)<#cr>KBD(VK_SHIFT,2,40)<#cr>KBD(VK_CTRL,2,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "Layer=GETID(<#dbl>レイヤー(S) (Shift+Ctrl+L)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,-1)<#cr>" endif ifb pos("検索",caption)>1 Result=_ "SCKEY(Inkscape,VK_CTRL,F)<#cr>KBD(VK_CTRL,2,40)<#cr>Sleep(0.2)<#cr>"+_ "Find=GETID(<#dbl>検索(F) (Ctrl+F)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,-1)<#cr>" endif ifb pos("変形",caption)>1 Result=_ "SCKEY(Inkscape,VK_SHIFT,VK_CTRL,M)<#cr>KBD(VK_SHIFT,2,40)<#cr>KBD(VK_CTRL,2,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "Trans=GETID(<#dbl>変形(M) (Shift+Ctrl+M)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,-1)<#cr>" endif ifb pos("整列",caption)>1 Result=_ "SCKEY(Inkscape,VK_SHIFT,VK_CTRL,A)<#cr>KBD(VK_SHIFT,2,40)<#cr>KBD(VK_CTRL,2,40)<#cr>"+_ "Align=GETID(<#dbl>整列/配置(A) (Shift+Ctrl+A)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,-1)<#cr>"+_ "MOUSEORG(Align)<#cr>BTN(LEFT,0,130,52,300)<#cr>Sleep(0.2)<#cr>BTN(LEFT,0,130,87,300)<#cr>"+_ "Sleep(0.2)<#cr>MOUSEORG(0)<#cr>" endif ifb pos("格子配置",caption)>1 Result=_ "SCKEY(Inkscape,VK_ALT,O)<#cr>KBD(VK_ALT,2,40)<#cr>KBD(VK_D,0,40)<#cr>Sleep(0.2)<#cr>"+_ "Grid_Arg=GETID(<#dbl>格子配置(D)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,-1)<#cr>" endif ifb pos("タイル",caption)>1 Result=_ "SCKEY(Inkscape,VK_ALT,E)<#cr>KBD(VK_ALT,2,40)<#cr>KBD(VK_N,0,40)<#cr>Sleep(0.2)<#cr>"+_ "KBD(VK_DOWN,0,40)<#cr>Sleep(0.2)<#cr>KBD(VK_RETURN,0,40)Sleep(0.2)<#cr>"+_ "Tiled_Clone=GETID(<#dbl>タイルクローンを作成<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,-1)<#cr>" endif ifb pos("XML",caption)>1 Result=_ "SCKEY(Inkscape,VK_SHIFT,VK_CTRL,X)<#cr>KBD(VK_SHIFT,2,40)<#cr>KBD(VK_CTRL,2,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "XMLEditor=GETID(<#dbl>: XMLエディタ(X) (Shift+Ctrl+X)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,0)<#cr>" endif ifb pos("テキスト",caption)>1 Result=_ "SCKEY(Inkscape,VK_SHIFT,VK_CTRL,T)<#cr>KBD(VK_SHIFT,2,40)<#cr>KBD(VK_CTRL,2,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "text_f=GETID(<#dbl>テキスト/フォント(T) (Shift+Ctrl+T)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,0)<#cr>" endif ifb pos("アンドゥ",caption)>1 Result=_ "SCKEY(Inkscape,VK_SHIFT,VK_CTRL,H)<#cr>KBD(VK_SHIFT,2,40)<#cr>KBD(VK_CTRL,2,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "History=GETID(<#dbl>アンドゥ履歴(H) (Shift+Ctrl+H)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,0)<#cr>" endif ifb pos("デバッグ",caption)>1 Result=_ "SCKEY(Inkscape,VK_ALT,V)<#cr>KBD(VK_ALT,2,40)<#cr>KBD(VK_M,0,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "debug=GETID(<#dbl>デバッグメッセージ(M)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,0)<#cr>" endif ifb pos("スクリプト",caption)>1 Result=_ "SCKEY(Inkscape,VK_ALT,V)<#cr>KBD(VK_ALT,2,40)<#cr>KBD(VK_C,0,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "script=GETID(<#dbl>スクリプト(C)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,0)<#cr>" endif ifb pos("アイコン",caption)>1 Result=_ "SCKEY(Inkscape,VK_ALT,V)<#cr>KBD(VK_ALT,2,40)<#cr>KBD(VK_N,0,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "icon=GETID(<#dbl>アイコンプレビュー(N)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,0)<#cr>" endif ifb pos("メモリ",caption)>1 Result=_ "SCKEY(Inkscape,VK_ALT,H)<#cr>KBD(VK_ALT,2,40)<#cr>KBD(VK_M,0,40)<#cr>"+_ "Sleep(0.2)<#cr>"+_ "ram=GETID(<#dbl>メモリ情報(M)<#dbl>,<#dbl>gdkWindowToplevel<#dbl>,0)<#cr>" endif Exit fend