Usual Right Click Menu as a Submenu

Features wanted...
Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Usual Right Click Menu as a Submenu

Post by Stefan »

SkyFrontier wrote:Right now I'm combining "New Items" as suggested by Hallgren with POM. Created a little script which simply does a copy of a file and opens it using Wordpad, once Notepad shows a lot of strange symbols and completely screws the formatting of history.txt.

Code: Select all

goto .\; writefile ("history_v8.txt", readfile("history.txt", t), o, ta); openwith wordpad, m, "<curpath>\history_v8.txt"; copytext "usual"; status "..."; #520
-anyone able to clean this code, please? Or is it fine? I do not like the "goto .\" / "#520" part - I'd like to simply press a button and have this newly (copy) created file opened with Wordpad, without in fact having to see the go-to-back-to dumb part of it.

As I am reading, POM may give a more comfortable solution - I'm just not familiar to it yet... (home lesson of the day)
You mean
- copy "history.txt" to "history_v8.txt" in current folder
- then open "history_v8.txt" with wordpad ?

One possibly would be:

Code: Select all

$copy = "<curbase>_v8.<curext>";
	copyitem "<curitem>", $copy;
	run "wordpad $copy";
Select "history.txt" and execute this script.
See wiki for all XY variables: http://88.191.26.34/XYwiki/index.php/Sc ... _Variables

You could also paste the script in the address bar:
::$copy = "<curbase>_v8.<curext>"; copyitem "<curitem>", $copy; run "wordpad $copy";

HTH? :wink:

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

Re: Usual Right Click Menu as a Submenu

Post by admin »

Stefan wrote:You mean
- copy "history.txt" to "history_v8.txt" in current folder
- then open "history_v8.txt" with wordpad ?

One possibly would be:

Code: Select all

$copy = "<curbase>_v8.<curext>";
	copyitem "<curitem>", $copy;
	run "wordpad $copy";
Select "history.txt" and execute this script.
See wiki for all XY variables: http://88.191.26.34/XYwiki/index.php/Sc ... _Variables

You could also paste the script in the address bar:
::$copy = "<curbase>_v8.<curext>"; copyitem "<curitem>", $copy; run "wordpad $copy";

HTH? :wink:
Well, wordpad will probably not find the file since $copy does not contain the full path. :wink:

BTW, I don't really understand why this should be a script anyway. Looks like a one time job to me... :?

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Usual Right Click Menu as a Submenu

Post by Stefan »

admin wrote:
Stefan wrote:You mean
- copy "history.txt" to "history_v8.txt" in current folder
- then open "history_v8.txt" with wordpad ?

One possibly would be:

Code: Select all

$copy = "<curbase>_v8.<curext>";
	copyitem "<curitem>", $copy;
	run "wordpad $copy";
Select "history.txt" and execute this script.
See wiki for all XY variables: http://88.191.26.34/XYwiki/index.php/Sc ... _Variables

You could also paste the script in the address bar:
::$copy = "<curbase>_v8.<curext>"; copyitem "<curitem>", $copy; run "wordpad $copy";

HTH? :wink:
Well, wordpad will probably not find the file since $copy does not contain the full path. :wink:

BTW, I don't really understand why this should be a script anyway. Looks like a one time job to me... :?
Admin>Well, wordpad will probably not find the file since $copy does not contain the full path. :wink:
Well, it just works :D Probably because 'wordpad' is launched with the current path as default working dir.
An moment please, i will asking the help:
Syntax
run command, [directory], [wait=0]
[directory]
The working directory, allows you to skip the path in command; defaults to current path.
It seams the xy-coder have think about everything.

Admin> BTW, I don't really understand why this should be a script anyway. Looks like a one time job to me... :?
I try to never ask this question, only give an hint if possible.
The quester may have his own idea, maybe it's just an example? :D

Thanks for the response Admin.

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Usual Right Click Menu as a Submenu

Post by SkyFrontier »

Stefan:

Did the following:

Code: Select all

writefile ("<xypath>\history_v8.txt", readfile("<xypath>\history.txt", t), o, ta); openwith wordpad, m, "<xypath>\history_v8.txt"; status "Success: History copy created!";
Which I can use also this way (thanks for your idea!)

Code: Select all

writefile ("<xypath>\history_v8.txt", readfile("<xypath>\history.txt", t), o, ta);
   openwith wordpad, m, "<xypath>\history_v8.txt";
   status "Success: History copy created!";
Tried to adapt the "run "wordpad $copy";", but I still can't uderstand how to assign a reference like "$copy".

Something like:

Code: Select all

$writefile = writefile "<xypath>\history_v8.txt", readfile("<xypath>\history.txt", t), o, ta", $writefile;
   run "wordpad $writefile";
   status "Success: History copy created!";
or variations simply won't work.
One day I got it... lol

-is it possible to make XY read the "Version X.YY.ZZZZ" section of History.txt and name the final file as "history_vX_YY_ZZZZ.txt", deleting first ANY previous versions of files named "history_v*.txt"? Alternatively it could read the .INI value "LastVer=", but only as an alternative once I learned that XY can "getkey" so that could be easier (at least for a non-scripter like me!) and I did like it to get the REAL info from the REAL source file (History.txt).
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Usual Right Click Menu as a Submenu

Post by SkyFrontier »

admin said:
BTW, I don't really understand why this should be a script anyway. Looks like a one time job to me...
In my case, I'll have to open XY History using WORDPAD instead of default NOTEPAD because when using Notepad it opens a non-formatted, full of cryptic signs document which renders it unreadable. It's not an option to set Wordpad to ALWAYS open .txt (mainly because of the different ways both of them deal with "search" function). Also, I'm getting used to the POM feature so may have another way to workaround this. Concerning .txt/Word/Notepad, I have to regularly open several versions of those files to eye-compare them, sometimes having to assign them control numbers/versions (the "_v8" can turn into a <dd_mm> variable).

For the Note/Wordpad/cryptic signs issue, I've found MED editor which can "Convert to Windows" formatting, thus allowing Notepad to open a fixed History.txt without any hassle.

And as I'm involved in a solo "New User's Guide" project, it may also be of a reference to any(newbie)one out there trying to get XYplorer's full power. So yes, it's both an example and a help to me! =)
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Post Reply