% % save the screen, load it into Photoshop % "_owner.txt" ofdesk exec % % get the screen area of interest for mobile selection % "_form.jpg" ofbin dup % % stack: screen-jpeg screen-jpeg % _Pshop.Screen < |Tree *atoparea |Shoot % % include task tree and controls % *atoparea *atoharea pop3 pop3rd exch |Active *atoharea |Screen .005 .005 .99 .99 > not { % % get most of the screen, trimmed on bottom and right % *atoparea pop3&4 pop2nd .005 .005 .70 4 -1 roll } if % % stack: screen-jpeg screen-jpeg x-per y-per w-per h-per % perscreen fourth !xglo third !yglo second !wglo dup !hglo screen % % stack: screen-jpeg % *jsphfspc quoter % % calculate ratios to fill width and height from image % _Pho.ViewX "phovx " log() _wglo normreal div !mulw _hglo _mulw mul normint !yexp _Pho.ViewY "phovy " log() _hglo normreal div !mulh _wglo _mulh mul normint !xexp "expand " &_wglo &" " &_hglo &" " &_xexp &" " &_yexp logs % % check how vertical sizing fits when using horizontal ratio % _yexp _Pho.ViewY gt { % % horizontal ratio causes vertical overage, use vertical ratio % _xexp _Pho.ViewY _mulh } { % % horizontal ratio allows vertical to fit within limits % _Pho.ViewX _yexp _mulw } ifelse "mul " log() % % record the axis ratio that was used % !Pho.Mul "choice " &3 &" " log() % % record the calculated resize of screen cap % to fit mobile device % !Pho.CalcY !Pho.CalcX % % create the javascript needed to size image and adjust canvas % ^"//+Hosting //+Selection //* app.open(new File(" &")); var sizeWidth = new UnitValue( """ &_Pho.CalcX &" pixels"" ); var sizeHeight = new UnitValue( """ &_Pho.CalcY &" pixels"" ); var canvWidth = new UnitValue( """ &_Pho.ViewX &" pixels"" ); var canvHeight = new UnitValue( """ &_Pho.ViewY &" pixels"" ); " _Pho.ViewX _Pho.CalcX sub 2 div normint "diffx " log() !Pho.DiffX _Pho.ViewY _Pho.CalcY sub 2 div normint "diffy " log() !Pho.DiffY &"app.activeDocument.resizeImage(sizeWidth, sizeHeight); app.activeDocument.resizeCanvas(canvWidth, canvHeight); " _Pho.ViewX _Pho.ViewY *atopthum & &"app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); Continuing('atopttrf'); " %%% dup logs % % this command will have to be routed by the remote connection % token holder % *atopbuld % % write the jsx file referenced by screen xml % "Steppet.jsx" ofdesk write % % copy the Screen.xml to Stepper.xml for uplink to mobile device % "Screen" *atopttrg