snippet lab

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: snippet lab

Post by Stefan »

admin wrote:
eil wrote: or there is some way to direct it where to get script?
something like:
Code:

Code: Select all

ScriptL
  load <xydata>\scripts\my_sc.xys
Nope, not posssible.
Not possible to use Load() in an snippet?
I mean it is:

Code: Select all

Snip: CTB 1
  XYplorer 10.70.0200, 16.01.2012 16:57:34
Action
  NewUserButton
Name
  Archiver stuff
Icon
  <xypath>\Tools\ICONS\ZiP2.ico
ScriptL
  Load "..\Tools\Packer\Packer"
ScriptR
  Load 7zip;
FireClick
  0
@eil
please note that Load() looks first in "<xydata>\scripts\" so you don't have to use that as path.
Also you must not use the extension ".xys"!
So simple use "load my_sc".

admin
Site Admin
Posts: 64893
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: snippet lab

Post by admin »

Stefan wrote:Not possible to use Load() in an snippet?
Of course you can. But you cannot dynamically generate user button contents using snippet plus load().

Borut
Posts: 1465
Joined: 19 Oct 2010 19:29
Location: Win10 Pro 64b 22H2, @120DPI (125%)

Re: snippet lab

Post by Borut »

Hey people, I am quite late to this topic, but find it extremely interesting. What a potentially easy way to describe a user button to someone interested: a snippet file and (possibly) a script file! So I have to ask:

Why is this still unofficial?

Why is "Copy Snippet" still concealed on the User Button Editor?

Why is "Paste Snippet" concealed and grayed out?

Why not make the whole thing official and start "User Button Exchange" (a Button Library) in the forum?
Win 10 Pro 64bit

admin
Site Admin
Posts: 64893
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: snippet lab

Post by admin »

Yes, it's a cool feature. :)

Yes, it's still unofficial.

"Paste Snippet" is enabled when there is a valid snippet in the clipboard.

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: snippet lab

Post by Marco »

Some questions:
1. Is the structure of the first line fixed? I mean, what can I type after "Snip: "? Is this line necessary at all?
2. Is the second line necessary? Seems no, but what could be used for?
3. In the snipper here ( http://www.xyplorer.com/xyfc/viewtopic. ... 990#p77990 ) I had to indent with three spaces, not just two (else upon click a menu with the three load's appears). Is that a bug?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 64893
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: snippet lab

Post by admin »

Marco wrote:Some questions:
1. Is the structure of the first line fixed? I mean, what can I type after "Snip: "? Is this line necessary at all?
2. Is the second line necessary? Seems no, but what could be used for?
3. In the snipper here ( http://www.xyplorer.com/xyfc/viewtopic. ... 990#p77990 ) I had to indent with three spaces, not just two (else upon click a menu with the three load's appears). Is that a bug?
1./2. The format is not all meaningful yet. Let's called it "reserved for future use".

3. No, bug but you have to indent the non-first lines for what you want:

Code: Select all

ScriptL
   load "SimpleUpdater", "_Initialize";
     load "SimpleUpdater", "Updates";
     load "SimpleUpdater", "_Terminate";

Post Reply