Syntax for opening newly created files?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Megalith
Posts: 87
Joined: 24 Jan 2015 16:53

Syntax for opening newly created files?

Post by Megalith »

Sorry, this is probably obvious, but what syntax should I add to a script so a file is not only created but immediately opened?

highend
Posts: 14994
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Syntax for opening newly created files?

Post by highend »

open / openwith / run?
One of my scripts helped you out? Please donate via Paypal

Megalith
Posts: 87
Joined: 24 Jan 2015 16:53

Re: Syntax for opening newly created files?

Post by Megalith »

Yeah, but I can't figure out how to integrate the open command with, say, new("info.txt");.

highend
Posts: 14994
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Syntax for opening newly created files?

Post by highend »

Code: Select all

open new("info.txt", "file"), "w";
One of my scripts helped you out? Please donate via Paypal

Megalith
Posts: 87
Joined: 24 Jan 2015 16:53

Re: Syntax for opening newly created files?

Post by Megalith »

Oh, duh, so it was just a matter of adding "open" at the beginning. I played around with it and

Code: Select all

open new("info.txt");
seems to work fine; what does "file" and "w" do in your version?

highend
Posts: 14994
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Syntax for opening newly created files?

Post by highend »

"file" is the default for type in new() so it's not a necessity but I'm used to it (auto completion in my editor)
"w" = Use Window's associated application instead of preferring XY's PFA (and I use a script for all my PFAs...)
One of my scripts helped you out? Please donate via Paypal

Post Reply