I am working on an BatchMaker-Script
and want to use the name-part of an file name only.
For the script first i use smtg like:
$filelist = getinfo('SelectedItemsPathNames', '|');
$file=gettoken($filelist, 1, "|");
$name = regexreplace($file, ...);
$exte = regexreplace($file, ...);
Then i think about to use the "report" command,
but {name} gives me the fullname incl. the extension.
An possible output of my script could be for example:
::text report("REN {fullname} {fullpath}\{name}_backup.{ext}<crlf>",1);
Question:
Is there an native report-token to give me the file name without the extension?
Or could this be added as e.g. {namepart}?
Script: {namePART only} for Report command.
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Script: {namePART only} for Report command.
Variable <curbase> gives you the "file name without the extension".Stefan wrote:I am working on an BatchMaker-Script
and want to use the name-part of an file name only.
For the script first i use smtg like:
$filelist = getinfo('SelectedItemsPathNames', '|');
$file=gettoken($filelist, 1, "|");
$name = regexreplace($file, ...);
$exte = regexreplace($file, ...);
Then i think about to use the "report" command,
but {name} gives me the fullname incl. the extension.
An possible output of my script could be for example:
::text report("REN {fullname} {fullpath}\{name}_backup.{ext}<crlf>",1);
Question:
Is there an native report-token to give me the file name without the extension?
Or could this be added as e.g. {namepart}?
More variables here:
http://88.191.26.34/XYwiki/index.php/Sc ... #Variables
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Script: {namePART only} for Report command.
Thanks, but <curbase> give you only the "file name without the extension" for the currently focused file.serendipity wrote:Variable <curbase> gives you the "file name without the extension".Stefan wrote:I am working on an BatchMaker-Script
and want to use the name-part of an file name only.
For the script first i use smtg like:
$filelist = getinfo('SelectedItemsPathNames', '|');
$file=gettoken($filelist, 1, "|");
$name = regexreplace($file, ...);
$exte = regexreplace($file, ...);
Then i think about to use the "report" command,
but {name} gives me the fullname incl. the extension.
An possible output of my script could be for example:
::text report("REN {fullname} {fullpath}\{name}_backup.{ext}<crlf>",1);
Question:
Is there an native report-token to give me the file name without the extension?
Or could this be added as e.g. {namepart}?
More variables here:
http://88.191.26.34/XYwiki/index.php/Sc ... #Variables
This will not work for an whole list of files.
I need an token for the report command.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Script: {namePART only} for Report command.
Oh I see, you can use command ID #113 (menu "File>To Clipboard>Item Base")Stefan wrote:Thanks, but <curbase> give you only the "file name without the extension" for the currently focused file.serendipity wrote:Variable <curbase> gives you the "file name without the extension".Stefan wrote:I am working on an BatchMaker-Script
and want to use the name-part of an file name only.
For the script first i use smtg like:
$filelist = getinfo('SelectedItemsPathNames', '|');
$file=gettoken($filelist, 1, "|");
$name = regexreplace($file, ...);
$exte = regexreplace($file, ...);
Then i think about to use the "report" command,
but {name} gives me the fullname incl. the extension.
An possible output of my script could be for example:
::text report("REN {fullname} {fullpath}\{name}_backup.{ext}<crlf>",1);
Question:
Is there an native report-token to give me the file name without the extension?
Or could this be added as e.g. {namepart}?
More variables here:
http://88.191.26.34/XYwiki/index.php/Sc ... #Variables
This will not work for an whole list of files.
I need an token for the report command.
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Script: {namePART only} for Report command.
Thanks
See,
i already have an collected list of files (with: $filelist = getinfo)
from which i already get the base name of each item (with: $basename = regexreplace(gettoken($filelist, ...)
This all works already pretty fine!
But i thought i could use REPORT-command for my script,
and there i miss the {basename}-token, from the report-command.
Just to make the script straight forward, without workarounds and novice-simple
Like:
::text report("REN {fullname} {fullpath}\{name}_backup.{ext}<crlf>",1);
but:
::text report("REN {fullname} {fullpath}\{namebase}_backup.{ext}<crlf>",1);
See,
i already have an collected list of files (with: $filelist = getinfo)
from which i already get the base name of each item (with: $basename = regexreplace(gettoken($filelist, ...)
This all works already pretty fine!
But i thought i could use REPORT-command for my script,
and there i miss the {basename}-token, from the report-command.
Just to make the script straight forward, without workarounds and novice-simple
Like:
::text report("REN {fullname} {fullpath}\{name}_backup.{ext}<crlf>",1);
but:
::text report("REN {fullname} {fullpath}\{namebase}_backup.{ext}<crlf>",1);
-
admin
- Site Admin
- Posts: 66347
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Script: {namePART only} for Report command.
admin wrote:ok.
Works (i have tested this here: http://www.xyplorer.com/xyfc/viewtopic. ... 762#p40762)v8.70.0150 - 2009-12-15 12:46
+ SC Report(): Added special field {Basename}. Return the base (file
name without extension) of each file. Folder names are returned unchanged.
Thank you.
XYplorer Beta Club