How do I move a file to Trash Bin (NWJS)

Get help using Construct 2

Post » Sat May 21, 2016 6:10 pm

There's a "Delete file" action in Node Webkit / Nw.js, which seems to delete a file completely
Now how does one delete a file to have it in the system trash bin instead?
I guess I could use a "Move to", but then there's no NWJS expression for Trash folder apparently

PS: Also, had anyone tried to move large files with nwjs on Construct2?
Maybe it's just me, but it doesn't seem to work over 1Gb or so
B
22
S
6
G
8
Posts: 328
Reputation: 6,651

Post » Sat May 21, 2016 11:59 pm

you could test javascript + ActiveXObject + WScript.Shell but I think nw don't allow this
Image Image
B
25
S
14
G
136
Posts: 876
Reputation: 71,005

Post » Sun May 22, 2016 10:14 am

you can set a variable with bin path and use it

the path is C:\$Recycle.Bin
Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299

Post » Sun May 22, 2016 10:46 am

@MadSpy Thx but I don't know what that means either : ]

@Fidasx I was thinking of a universal variable like "NWjs.AppFolder" that would work on all platforms
How would you do it on mac and linux then?
Also the path to the bin seems a bit more complicated according to this
(and I didn't manage to make it work in c2 with that path)
B
22
S
6
G
8
Posts: 328
Reputation: 6,651

Post » Mon May 23, 2016 2:18 pm

yea you are right its more complicated than i thought i tried but its not working


the first problem is you can only have a path after a folder dialog
and the second problem is paths ,folder or file names must not have spaces
Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests