What was that thing with Photoshop images?

J. Landman Gay jacque at hyperactivesw.com
Thu Aug 9 19:21:35 EDT 2012


On 8/9/12 4:27 PM, Peter M. Brigham wrote:
> On Aug 8, 2012, at 11:52 AM, J. Landman Gay wrote:
>
>> That could very well be. The image was imported into the stack but
>> not via the File menu. I did it from the message box via a handler
>> I've used for years. It just takes a file path and puts the image
>> from disk into an existing image. It's one of the handiest
>> shortcuts I have when I want to update an image without changing
>> any of its properties, particularly its name and ID. I've never had
>> it fail before but it may have this time.
>
> Could you post that utility handler? I guess I could figure it out,
> but I'm feeling lazy...

It's pretty simple. I keep it in my custom backscript. When I want to 
replace an image I type "getpaint" into the message box. The image you 
want to update must be selected with the pointer tool first.

on getPaint -- replace an img's content; img must be selected
   if the selobj = "" then
     answer "Select an image first."
     exit getPaint
   end if
   answer file "Choose replacement image:"
   if it = "" then exit to top
   put url ("binfile:"&it) into the selobj
end getPaint

This is handy for an imported image that you want to update and you want 
to keep all its properties the same. In particular, you don't lose the 
ID so that button icons don't need to be reset.

There's no error checking, since it's one of those personal tools. If 
the selected object isn't an image you may be in trouble.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list