Search found 14 matches

by hover27
Fri Jan 15, 2021 1:48 pm
Forum: Switch
Topic: copy with Process.execute
Replies: 11
Views: 9419

Re: copy with Process.execute

jan_suhr wrote: Thu Jan 14, 2021 7:30 pm
It is probably because it isn't in the path for Switch to find it. A Switch Script is running in it's own environment and you have to adjust the path setting.
That was my first thought also, but 'copy' is an internal DOS command. There is no separate path for it.
by hover27
Thu Jan 14, 2021 6:19 pm
Forum: Switch
Topic: copy with Process.execute
Replies: 11
Views: 9419

Re: copy with Process.execute

@laurentd
that is exactly what I want to do.
Thank you, good idea.

It seems, that Switch isn't able to process the copy command with Process.execute().
by hover27
Thu Jan 14, 2021 11:16 am
Forum: Switch
Topic: copy with Process.execute
Replies: 11
Views: 9419

Re: copy with Process.execute

Ah, that's a good idea.
I will try this.
by hover27
Thu Jan 14, 2021 8:58 am
Forum: Switch
Topic: copy with Process.execute
Replies: 11
Views: 9419

Re: copy with Process.execute

@jan_suhr
no, that is not what I need.
I need to copy two files together.
That is only possible with the internal command copy.
With the parameters of copy, I can copy two files into one file.
That's why I need to do it with Process.execute() and the copy command.
by hover27
Thu Jan 14, 2021 8:30 am
Forum: Switch
Topic: copy with Process.execute
Replies: 11
Views: 9419

Re: copy with Process.execute

the script does not go to the line with the log, so there is no message/log entry for job.log(1, Process.stderr) when switch tries to execute Process.execute(theCommand) there is a message from with type = Error and Module = Control: Failed to run external process: copy C:\folder1\folder2\myFile.txt...
by hover27
Wed Jan 13, 2021 9:59 pm
Forum: Switch
Topic: copy with Process.execute
Replies: 11
Views: 9419

copy with Process.execute

Hi, I want to copy files with Process.execute() The reason therefor is, that I want to use some parameters, which aren't possible with Switch internal copy functin but with windwos copy. (to copy two files together) I tried to do this: path1 = "\"C:\\folder1\\folder2\\myFile.txt\"&quo...
by hover27
Tue Nov 19, 2019 5:01 pm
Forum: LEGACY scripting
Topic: how to remove an attribute from a xml node?
Replies: 5
Views: 6275

Re: how to remove an attribute from a xml node?

oh, that's new in Switch 2019. :D
thx
by hover27
Mon Nov 18, 2019 10:23 am
Forum: LEGACY scripting
Topic: how to remove an attribute from a xml node?
Replies: 5
Views: 6275

Re: how to remove an attribute from a xml node?

Thank you, that works.
by hover27
Sat Nov 16, 2019 12:05 am
Forum: LEGACY scripting
Topic: how to remove an attribute from a xml node?
Replies: 5
Views: 6275

how to remove an attribute from a xml node?

Hi,
I'm searching for a possibility to remove an attribut with scripting.
Does anyone knows how?

THX
hover
by hover27
Sun May 19, 2019 8:00 pm
Forum: LEGACY scripting
Topic: Scope question from a newbie
Replies: 4
Views: 6240

Re: Scope question from a newbie

That was exactly, what I was searching for.
Thank you for your very detailed explantation.
by hover27
Sat May 18, 2019 2:46 pm
Forum: LEGACY scripting
Topic: Scope question from a newbie
Replies: 4
Views: 6240

Scope question from a newbie

Hi,
how can I make the value of a local variable global?
I think in ECMAScript 6 this would work, but not in Switch Scripting (ECMAScript 4).

Code: Select all


var a = 7;
var b = 5;

if (a=7){
job.log(1, b); // 5
var b = 13;
job.log(1, b); // 13
otherstatements;
}
job.log(1, b); // 5


Thank you
by hover27
Wed Apr 24, 2019 11:29 am
Forum: LEGACY scripting
Topic: RegEx replace in Script expression
Replies: 4
Views: 7257

Re: RegEx replace in Script expression

Thank you, both works :-)
by hover27
Sun Apr 21, 2019 1:00 am
Forum: LEGACY scripting
Topic: RegEx replace in Script expression
Replies: 4
Views: 7257

Re: RegEx replace in Script expression

I answer myself: look here: http://www.enfocus.com/manuals/DeveloperGuide/SW/18/home.html#en-us/common/sw/reference/r_regexp.html .replace doesn't work in Switch Javascript. The solution looks like this: re = /name: ([a-zA-Z ]+)/; re.search( "name: John Doe, age: 42" ); re.cap(0); // retur...
by hover27
Sat Apr 20, 2019 4:14 pm
Forum: LEGACY scripting
Topic: RegEx replace in Script expression
Replies: 4
Views: 7257

RegEx replace in Script expression

Hi, I'm new with scripting in Switch.<br/> I would like to replace RegEx Strings by group. For example a string like 'a1b2c3_DDYYKK_123_ABC_X1Y1Z1' The replaced string should be the substring between the 2nd and 3rd underscore -> '123' If I use replace, that does not work. Does anyone have an idea, ...