Hello sgp,
I think I should clean up the Win+C Win+V Win+X script,
using the standard extension .PowerProClip instead of .ClipSaver,
and upload it to our Files as a kit.
So please let me know of any errors or suggested enhancements.
> Using Win+C (copy)
> I got an error message from ClipSaver.powerpro,
> Cannot read from file for clip load
> c:\path\to\Powerpro\clip2\temp.ClipSaver
Thanks for letting me know about that.
Yes your suggestion to use the following would fix it:
> if(file.validpath(ClipDir2++?"\temp.ClipSaver"))
> clip.load("temp.ClipSaver",ClipDir2)
but as you point out:
> although I wonder if clip.save doesn't say if it did create a file
> then potentially the above code could
> restore an old temp.ClipSaver file (corner case)
That is probably not people would want,
therefore I think this would be better:
If(clip.listformats)do
local zClipSaved = 1
clip.save("temp.ClipSaver",ClipDir2)
endif
...
If(zClipSaved)do
clip.load("temp.ClipSaver",ClipDir2)
endif
Note: zClipSaved must be a local, else preset it to 0.
The same change should be made to the @App0_Paste routine.
That is probably a good idea in all other scripts too;
anywhere a routine which uses the clipboard
is surrounded by Clip.Save and Clip.Load.
Notice that: If(clip.listformats)do
is better than: If(clip)do
or: If(clip.get)do
because they return "" when it is only a bitmap.
---------------------------------------------
By the way...
I used a non-standard extension .ClipSaver instead of .PowerProClip
in the ClipSaver script.
Now I think it would be much better to use the standard extension
because of the tooltip PP provides when you hover on a saved clip
in a menu, and various other features for those files such as
double click to load it into the clipboard.
My reasons for using my own extension are no longer valid.
I wrote it when the new multi-format clips had just been
introduced, so there were fewer features then than now.
I made my own file associations for .ClipSaver files because I wanted:
- an icon in file listings
- an associated command for double click to load the clip
- smart file naming with date and time and type of clip
- a right click context menu
Now PowerPro provides all those things in its file association for
.PowerProClip, except the context menu item, which I add like this:
REGEDIT4
[HKEY_CLASSES_ROOT\PowerPro.Clip\shell\ppdebug]
@="Debug clip formats"
[HKEY_CLASSES_ROOT\PowerPro.Clip\shell\ppdebug\command]
@="\"c:\\shells\\powerpro\\powerpro.exe\" [EMAIL PROTECTED](\"%1\")"
which leads to this in .ClipSaver :
@ExplorerDebug
;; from Explorer context menu for .PowerProClip and .ClipSaver files
;; arg(1) is the full filepath
ClipDir2 = ?"E:\ClipSaver"
;; That was added for this message,
;; I set global ClipDir2 in scheduler startup.
If(clip.listformats)do
local zClipSaved = 1
clip.save("temp",ClipDir2)
endif
clip.file(arg(1))
if(clip.get == "")do
local z_ShortText = " -- no text --"
else
local z_ShortText = [EMAIL PROTECTED]
endif
debug
win.debug("File name: ",file.nametype(arg(1)))
win.debug("Formats: ",clip.ListFormats)
win.debug("Text starts: ",z_ShortText)
debug
If(zClipSaved)do
clip.load("temp",ClipDir2)
endif
quit
;; end of .ClipSaver script file
Note: I just added an extra check to the temp save and load thanks to sgp.
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/