Is there anything wrong with this script?

Discuss and share scripts and script files...
Post Reply
ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Is there anything wrong with this script?

Post by ivan »

It seems running this script doesn't create the temp folder even though it should. What might be the reason? :(

Code: Select all

Set($cf,<curfolder>);
   Set($cp,<curpath>);
   Set($nn,<date yyyymmddhhnnss>);
   OpenWith("""C:\program files\winrar\winrar.exe"" e -- *.rar * $nn-temp", "s");
   Msg("Press OK when WinRAR is finished.",1);
   GoTo("<curpath_s>\$nn-temp")
   Sel(a);
   Rename(bat,$cf);
   Focus(L);
   MoveTo("..\..");
   #523;
   #523;
   Rename(bat,$nn,,"$cp");
   SelFilter($nn, d, Name);
   Focus(L);
   #170;
Windows Vista Business SP1 32-bit, Logitech MX400 mouse, SetPoint 4.60.122
Image

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Is there anything wrong with this script?

Post by serendipity »

ivan wrote:It seems running this script doesn't create the temp folder even though it should. What might be the reason? :(

Code: Select all

   Set($cf,<curfolder>);
   Set($cp,<curpath>);
   Set($nn,<date yyyymmddhhnnss>);
   OpenWith("""C:\program files\winrar\winrar.exe"" e -- *.rar * $nn-temp", "s");...
I am not sure if Winrar can create $nn-temp for you here, therefore you can create it yourself before extracting something into it. Place this before openwith command:

Code: Select all

new "$nn-temp", dir;

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Re: Is there anything wrong with this script?

Post by ivan »

serendipity wrote: I am not sure if Winrar can create $nn-temp for you here, therefore you can create it yourself before extracting something into it. Place this before openwith command:

Code: Select all

new "$nn-temp", dir;
Thank you very much, it has helped. Also, I forgot to add a semi-colon after

Code: Select all

GoTo("<curpath_s>\$nn-temp")
so that caused XY to fail to navigate to the wrong place ;)
Windows Vista Business SP1 32-bit, Logitech MX400 mouse, SetPoint 4.60.122
Image

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

Re: Is there anything wrong with this script?

Post by SkyFrontier »

Fixed version based on suggestions:
(NOT TESTED!)

Code: Select all

   Set($cf,<curfolder>);
   Set($cp,<curpath>);
   Set($nn,<date yyyymmddhhnnss>);
   new "$nn-temp", dir;
   OpenWith("""C:\program files\winrar\winrar.exe"" e -- *.rar * $nn-temp", "s");
   Msg("Press OK when WinRAR is finished.",1);
   GoTo("<curpath_s>\$nn-temp");
   Sel(a);
   Rename(bat,$cf);
   Focus(L);
   MoveTo("..\..");
   #523;
   #523;
   Rename(bat,$nn,,"$cp");
   SelFilter($nn, d, Name);
   Focus(L);
   #170;
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...

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

Re: Is there anything wrong with this script?

Post by admin »

SkyFrontier wrote:Fixed version based on suggestions:
(NOT TESTED!)
...
Sorry, but you seem to post all day long, and now you start to post UNTESTED scripts (or did you just start to tell us that your scripts are untested?). Please, keep the untested stuff at home. This is a public forum. Thanks.

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

Re: Is there anything wrong with this script?

Post by SkyFrontier »

That was the best I could do, Don.
Sorry if this hurts your feelings, too.
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...

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

Re: Is there anything wrong with this script?

Post by admin »

SkyFrontier wrote:That was the best I could do, Don.
Sorry if this hurts your feelings, too.
It was not about my feelings, it was rather the ultra-rational cerebral part of my soul that asked: Why would anybody publish an untested script in the script exchange section? Air code is crap most of the times.

It's simple: If you have something good: share it. If you have a question that you cannot answer yourself by studying the Help and other sources, by trying, by thinking, and whose answer will be interesting to other users: ask it.

Simply increasing the forum byte count by repeating old and non-revised posts in a new order is no so good IMO. There's a well structured place to put valuable info about XY: the XYwiki.

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Is there anything wrong with this script?

Post by j_c_hallgren »

admin wrote:There's a well structured place to put valuable info about XY: the XYwiki.
Unfortunately the wiki has been down for last few days...I sent a PM to jacky about it on the 4th but it's not yet been read...I also just sent email to him today...I think the wiki may need to be relocated to under your control to avoid this issue.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

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

Re: Is there anything wrong with this script?

Post by SkyFrontier »

Not air code and not about increasing post count.
Self:
Fixed version based on suggestions
.
But... it's your party, right?
Admin always win.
I'm sorry.
For reference, XYwiki is down for a pretty whole week or more.
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