open file/url externally

Request a new command, feature, or improvement

Moderator: MSandro

Post Reply
User avatar
Picochilla
Posts: 28
Joined: Sep 23rd, '17, 17:44

open file/url externally

Post by Picochilla » Apr 7th, '18, 19:54

Hi, is it posible to open a file (path/url) with GP? So GP would be able to open a website with the users standard browser or open a text file with the default editor. If not, it would be nice if you could add it to your task list. This would be very helpful.

Thank you very much.

MSandro
Posts: 162
Joined: Jul 26th, '17, 21:12

Re: open file/url externally

Post by MSandro » Apr 8th, '18, 10:40

Nice idea, but I think I've already submitted a similar idea, which, to my knowledge, did not quite match the ideas of John. It was something like a "run code" block that would allow opening files / URLs and much more. I've already seen something like this in some scratch 1.4 modifications. An "open file / url" block would make it possible to execute written scripts, at least under Windows, under Linux and probably also Mac this is probably rather unfortunate to realize, because the files would have to be made executable.
Bildschirmfoto vom 2018-04-08 12-40-38.png
Bildschirmfoto vom 2018-04-08 12-40-38.png (4.57 KiB) Viewed 17901 times

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: open file/url externally

Post by JohnM » Apr 10th, '18, 19:57

There is no way to do this in GP right now.

The general case of running an executable file is a big security hole that I'd rather not put into GP. That includes opening a file, too, since "opening" an exe or shell script file might execute it.

It might be worth considering a command that is limited to opening a browser on a given URL. I believe such a command could work in the browser version of GP, as well as in the stand-alone version (although it probably could not open local files for security reasons).

Are you more interested in opening local files or remote URL's?

User avatar
Picochilla
Posts: 28
Joined: Sep 23rd, '17, 17:44

Re: open file/url externally

Post by Picochilla » Apr 11th, '18, 13:19

Honestly both, but of course I can understand your concerns about safety. Opening files would greatly improve the interaction with the operating system and would give us many new opportunities. I do not know any reasonable programming language that does not allow the external opening of files.

MSandro
Posts: 162
Joined: Jul 26th, '17, 21:12

Re: open file/url externally

Post by MSandro » Apr 11th, '18, 15:54

It would be very useful, but of course you should not neglect safety. Nevertheless, I support the statement of Picochilla because GP should be used as professionally as other programming languages, in contrast to Scratch and other block-based languages which are mostly aimed at learning. So you should not restrict the programming that the tool GP because of the security aspect. Many programming languages value security without sacrificing functions that restrict the programmer / user.

Post Reply