How do I open/execute an external offline file

Get help using Construct 2

Post » Mon Oct 12, 2015 9:28 pm

At my work I was asked to propose a user interface to open .pdf and excel files (on Adobe reader and excel 2010) installed on a Windows Tablet

I managed to create this: https://dl.dropboxusercontent.com/u/21568607/Tablet_InterfaceB/index.html

My idea was to create this interface and export it to .exe using the NW.js exporting function.

Unfortunately I didn't check if Construct 2 had the function to open external files and for now I haven't succeeded to do it.

Please, does somebody knows of a way to do this?
Maybe some plugin or something else? :?: :(
B
21
S
4
G
1
Posts: 6
Reputation: 2,186

Post » Mon Oct 12, 2015 9:48 pm

If you add NWjs object to the project then do something like Button on clicked NWjs Run "e:\downloads\1.pdf" obviously replacing this with the path and .pdf
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Post » Tue Oct 13, 2015 7:18 am

You can also use the NW.js file actions to browse for a file, and as long as the file associations are setup - i.e. there are programs to handle xls and pdf files installed on the system - then NW.js will launch the relevant application after a file is selected.

Eample attached (requires r212 or above): Launch File from NW.js.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
137
S
31
G
87
Posts: 5,545
Reputation: 60,434

Post » Thu Oct 15, 2015 4:47 pm

Wow, it works!! Thank you guys!

btw, first I was using document names with spaces between, but it seems it will only open files without spaces ("01_filename.pdf" instead of "01 filename.pdf")

Thanks!
B
21
S
4
G
1
Posts: 6
Reputation: 2,186


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest