He Rémi, great idea  big_smile
Intuitive and works well.
Fine with the tool tips!
Well done. Good work.

And it works
(UNDO works too, btw)

FROM:
Test File 1! 2# 3$ 4( 5) 6+ 7, 8- 9. 0; 1= 2@ 3] 4_ 5{ 6} 7~.txt
TO:
Test File 1! 2A 3B 4C 5D 6E 7F 8G 9. 0H 1I 2J 3L 4M 5N 6O 7P.txt
USE:
"File > Preferences > Characters ==> Characters to replace"
From: #$()+,-;=@[]_{}~
To:ABCDEFGHIJKLMNOP
Expression: %f

---

FROM:
Test File 1! 2# 3$ 4( 5) 6+ 7, 8- 9. 0; 1= 2@ 3] 4_ 5{ 6} 7~.txt
TO:
Test File 1! 2A 3B 4C 5D 6E 7F 8F 9. 0F 1F 2F 3F 4F 5F 6F 7F.txt
USE:
"File > Preferences > Characters ==> Characters to replace"
From: #$()+,-;=@[]_{}~
To:ABCDEF
Expression: %f




http://img818.imageshack.us/img818/9004/sirenrenamerchartorepla.png


.

Thinking about it the whole afternoon.
First i thought, to geeky, yes. But now I think it's fine.

FROM
TO
RESULT

F: ABCDE
T: 12345
R: 12345

F: ABCDE
T: 12345678
R: 12345

F: ABCDE
T: 1234
R: 12344

F: ABCDE
T: 123
R: 12333

F: ABCDE
T: 12
R: 12222

F: ABCDE
T: 1
R: 11111

F: !#$()+,-;=@[]_{}~
T: _
R: _________________


Lets see what the user get:
1 - same To amount = every item is replaced on its own
2 - lesser To amount = first items are replaced on it own, remaining items are replaced with same sign
3- single To = every item is replaced with same sign
4 - more To then From = additives are silently dropped

For 2, the user may wonder or even worser, gets unwanted result.
So I think the idea is fine, but you should maybe still show a warning message like
"Attention: you have entered %s From but %s To. Are you sure?"
"Attention: you have entered less To (%s) then From (%s). Some or all From will get same To sign. Are you sure?"
"Attention: you have entered more To (%s) then From (%s). The additive will be ignored . Are you sure?"

.

Just a idea from my tests. No real wish.



For "File > Preferences > Characters ==> Characters to replace"

it is troublesomely to enter exactly as many replacement sings as sings to replace.


E.g:
From: !#$()+,-;=@[]_{}~
To: _________________

i have to enter 17 underscores too.



Here i would suggest to add a check box like

From: [ !#$()+,-;=@[]_{}~                                         ]
To:     [ _                                                                     ]
"[X] Replace every "From" sign with the same single sign from "To" field"


which limits the "To" box to an single char if checked.


Make sense ;-) ?
.

Q: How can i best remove symbols like '!' and '#' from file name?

     FROM:
     Test File 1! 2# 3$ 4( 5) 6+ 7, 8- 9. 0; 1= 2@ 3] 4_ 5{ 6} 7~.txt
     TO:
     Test File 1 2 3 4 5 6 7 8 9. 0 1 2 3 4 5 6 7.txt




A: You can utilize "File > Preferences > Characters"

     There is an option to remove certain signs: "!#$()+,-;=@[]_{}~"  (Just enter your wanted signs in the box)

     or to replace them by other signs: "!#$()+,-;=@[]_{}~" > "_-_-_-_-_-_-_-_-_"  (Note: both list must be same length)


Note: as expression still use "%b.%e"
(or "%f", it is shorter)





For to remove only a few symbols, like '#()' only
     e.g. TO: Test File 1! 2_ 3$ 4_ 5_ 6+ 7, 8- 9. 0; 1= 2@ 3] 4_ 5{ 6} 7~.txt

you can also use a concatenation of String modifier "( )" as String replacement
     Expression: %f("#","_")("(","_")(")","_")

or a concatenation of String modifier "( )" as String replacement with RegEx
     Expression: %f(s/[#\(\)]/_/g)




.

55

(13 replies, posted in Announcements)

It works well with fresh unpacked
Siren_311_beta2_build_944_windows_(26.02.2013)\
Siren_312_beta1_build_947_windows_(19.03.2013)\

I see now it is the ini.

The same ini with 311 let crash it too.
A fresh ini -by deleting the ini first- let work 312 again.

I have nothing testbed related found in the ini but "rec_testbed=398 413 687 483"
Deleting this line did not help.



Let me know if you need my ini.
Wait, I did an test, see if you can access this
https://docs.google.com/file/d/0BwJ3054 … sp=sharing

56

(13 replies, posted in Announcements)

Hi Rémi.

Let me try it again after a restart of the pc or on another pc ;-)

For the scenario:
I just have launched Siren
and chosen  "Expression testbed" from the menu.
Then i only get this message as mentioned above.

Otherwise i could work with it on real files as fine as ever.


I use Siren_312_beta1_build_947_windows_(19.03.2013)

on Win 7 64-bit

siren.exe
8.437.760
30.04.2012 09:25
19.03.2013 18:30
3.1.2.0
3.10
Rémi
Siren is a file renamer
3.12 beta 1 build 947
Copyright © 2002-2013 Rémi
MD5: DE7CE5848B2651E00B8D03E7679232A5

57

(0 replies, posted in How to ...)

Q: How to remove doubled extension?

  FROM:
  imagename.JPG.jpg

  TO:
  imagename.jpg
 


 
A: Use a String Modifier like:
 
  Expression: %b(".jpg","").%e

 
  Explanation: We use an "Replacement String modifier" to find and replace something on the "Variable" %b
 
                           Since only the last dot of the file name indicates the extension,
                           the first '.JPG' is only a part of the file name and can be modified as everything.


Variables

  A lot of information is extracted from files or can be computed based on different elements.
  Each of these information can be used in a rename expression through a "variable".   
  For example :
    %b    the "base" name (ie for "autoexec.bat" it is "autoexec")
    %e    the name extension (ie for "autoexec.bat" it is "bat")
 

Modifiers

  For example: change case, delete some characters, switch parts, modify the format of a date ...
  Modifiers are the tools that will achieve this.
  For example String modifier : "( )" 
  Used for "String replacement"
  The usage is near of the standard "replace" : ( "s1", "s2", s, n, c )
      s1    string to replace.
      s2    replacement string. If it is not specified, the string to replace is deleted
       s    starting occurrence. If negative, it is relative to the end of the string
      n    number of replacements to do. If negative, all remaining occurrences are treated
      c    number indicating if the search is case sensitive :
           0 (zero) for no, any other value for yes



See Siren Help (?) for more explanation.

Tested with Siren_312_beta1_build_947_windows_(19.03.2013)

58

(13 replies, posted in Announcements)

Hi Rémi, thank you for the update.


If i launch "Expression testbed" i get

Problemereignisname:    APPCRASH
  Anwendungsname:    siren.exe
  Anwendungsversion:    3.1.2.0
  Anwendungszeitstempel:    5148a0a4
  Fehlermodulname:    StackHash_0a9e
  Fehlermodulversion:    0.0.0.0
  Fehlermodulzeitstempel:    00000000
  Ausnahmecode:    c0000005
  Ausnahmeoffset:    00000000
  Betriebsystemversion:    6.1.7601.2.1.0.256.4
  Gebietsschema-ID:    1031

Siren_312_beta1_build_947_windows_(19.03.2013) on Win 7 64-bit

Issue:
I want to change the case of all first letters to upper case. BUT in the (...) parentheses ONLY.

FROM:
I have to learn because i don't know Siren Renamer (It's not that heavy).txt

TO:
I have to learn because i don't know Siren Renamer (It's Not That Heavy).txt

USE:
String modifier : "[ ]"
It will be split into an array of substrings following the specified separator characters.

in combination with
Case modifiers
Case modifiers are specified just after the '%' of the variable :
u >> all characters upper-case
l >> all characters lower-case
U >> first character of each word upper-case, the others lower-case.
     The words are separated by the characters specified in
     "Preferences/New name computation/Word separator characters".
L >> first character upper-case, the rest lower-case



Expression:
%b[1,"("] \(%Ub[2,"("].%e


Explanation:
%b[1, "("]    >> will split the string at the "(" sign and give the first part back. We use this just unchanged.
" \("             >> add an blank and the split delimiter again. (It seems the String modifier drop trailing spaces)
%Ub[2,"("]  >> give me part 2 of the split file name. The "U" means here: change to Title Case
.%e             >> add the original extension.




Tested with Siren File Renamer v3.00 rc1 build 900 ( don't ask ;-) Times flies ... and, this is a old test pc)

(Sorry Stefan, I stupidely updated your post. I've tried to restore it as to what it originally was ...)

i think about write infos to files content.
EXIF date
File time stamps

Further i have an question:
is the Audio Tag group related to ID3 v2 ?
I guess yes but have only an other naming because it may not 100% ID3v2.x compatible???

From the Completion dialog i can't open the related help by pressing F1.
e.g. being on the Modifiers tab, an user may want to press F1 to open the related help.

61

(2 replies, posted in Evolution requests)

Fine you still improve Siren  big_smile

I think this new option is needed most for video files.
There was such request now and then and we had to use an script or too many steps for and back to do this.
With you newest improvement it seems easy to do.

Could that also be used to serialize groups of files?

Example, serialize every four files:

FROM:

file A abc.ext
file A abc 2.ext
file A haha.ext
file A ooo.ext

file B def.ext
file B def 2.ext
file B hihi.ext
file B uuu.ext

TO:

file A_001.ext
file A_002.ext
file A_003.ext
file A_004.ext

file B_001.ext
file B_002.ext
file B_003.ext
file B_004.ext

USE:
%<4>b(1,6)_%n.%e

???

It seems our newest friend has lost the interest?

reviewing wrote:

My question is about how to sort the File List.

To sort the files in the file list view in an different order then by the starting chars of the file name,

you may want to read that how-to's

How to ...  → Advantage sorting
http://scarabee-software.net/forum/viewtopic.php?id=136


How to ...  → I want to sort by the fifth letter of the name
http://scarabee-software.net/forum/viewtopic.php?id=171



HTH?  smile

64

(3 replies, posted in Bugs and problems)

OK, then some more info about that issue.
Since i am not good into english, i provide a few google results.



1.) User Account Control Data Redirection



2.)

UAC Virtualization


By default, UAC virtualizes requests for protected resources to provide compatibility
with applications not developed for UAC.
This is important because many applications written for Windows XP and earlier operating systems
assume that the user has administrative privileges and attempt to write to protected resources
such as the Program Files or System folders.

UAC virtualization redirects requests for the following resources to safer, user-specific locations:

    * %Program Files%
    * %WinDir%
    * %WinDir%\System32
    * HKEY_LOCAL_MACHINE\Software

When a user process attempts to add a file to a protected folder,
UAC redirects the request to the \AppData\Local\VirtualStore\ folder in the user's profile.

For example, if a user named MyUser runs an application that stores a log file
at C:\Program Files\MyApps\Logs\Log.txt, the file write attempt will succeed.

However, UAC will actually store the file
at C:\Users\MyUser \AppData\Local\VirtualStore\Program Files\MyApps\Logs\Log.txt.

The application will be able to access the file at C:\Program Files\MyApps\Logs\Log.txt,
but the user will need to browse to her profile to access the file directly, because virtualization
affects only the application process itself. In other words, if the user browses to open the log file
from within the application, it will appear to be under %Program Files%.

If the user browses to open the log file using a Windows Explorer window, it will be under her profile.

from: http://sourcedaddy.com/windows-7/ … ation.html



BTW
there is also an 32-bit redirection on 64-bit Win7
* Registry Redirector
* File System Redirector

Running 32-bit Applications

WOW64 is the x86 emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows.
WOW64 is provided with the operating system and does not have to be explicitly enabled.

The system isolates 32-bit applications from 64-bit applications, which includes preventing file and registry collisions.

http://msdn.microsoft.com/en-us/library … v=vs.85%29

65

(2 replies, posted in Bugs and problems)

>>Under Windows 7, where should be copied the program folder: "%ProgramFiles(x86)%" or "%ProgramFiles%"?

This depends on if your Win7 system is 32- or 64-bit.

Since Siren 3.0 for WindowsTM is an 32-bit application
the place on 32-bit windows is "%ProgramFiles%" anyway
and on 64-bit windows would be "%ProgramFiles(x86)%" .

But normally one would store his portable tools anyway on an other partitions
e.g. in an folder "F:\Tools". There they remain even if you have to reinstall windows on C:-Partition.

If you store it under ProgramFiles (or x86, no matter) and have UAC turned on
there may be some issue you have to understand if you work with WindowsTM.
If you store it outside of ProgramFiles there will be no issue at all.
F.ex.: "C:\MyTools\" will do perfectly. But even better store it on an other partition.


Back ground:

Since Win7 with enabled UAC doesn't allow write access on ProgramFiles (or x86, no matter)
it redirects access to such an folder under ProgramFiles to an place the user have write access,
that is VirtualStore folder in the user profile folder like "%AppData%\..\Local\VirtualStore\Program Files\Siren\".

That is; Win7 lies to you and the application too.
Both you think the ini file is under ProgramFiles\Siren
but Windows have redirected it in the back ground for you for security reasons.


Work around:

If you understood windows you can give the user group "USERS"
MODIFY-right on the program folder "Siren" under ProgramFiles
and the INI will be written to the folder where the Siren.exe is again.
(You may want to copy the ini from VirtualStore if you need your old settings)

66

(3 replies, posted in Bugs and problems)

>>Under Windows 7, the options file is not in the program folder

Sure it is!
If you store it under ProgramFiles and have UAC turned on
there may be some issue you have to understand if you work with WindowsTM.
If you store it outside of ProgramFiles there will be no issue at all.


>>but in "%AppData%\..\Local\VirtualStore\Program Files\Siren\".

That is an Win7 feature if you have enabled UAC.
Since it doesn't allow write access on ProgramFiles
it redirects access to such an folder under ProgramFiles
to an place the user have write access,
that is VirtualStore folder in the user profile folder.

Win7 lies to you and the application too.
Both you think the ini file is under ProgramFiles\Siren
but Windows have redirected it in the back ground for you for security reasons.


If you understood windows you can give the user group "USERS"
MODIFY-right on the program folder "Siren" under ProgramFiles
and the INI will be written to the folder where the Siren.exe is again.
(You may want to copy the ini from VirtualStore if you need your old settings)


But normally one would store his portable tools anyway on an other partitions
e.g. in an folder "F:\Tools". There they remain even if you have to reinstall windows on C:-Partition.

Question:

Could it be that the %1-Path string is too long, so the rest of the command line gets cut?
If yes, you can use SUBST to shorten the path first.

(I googled for an better description and maybe this will help to understood (join the lines first):

http://
superuser.com/
questions/37737/
how-do-i-extend-the-maximum-file-path-size-in-windows-7)



My thought:

That cut would be no matter for the trailing "-f *.*" part
(see Rémi comment above) in the second example.

But for the trailing " -r -q" part in the first example this would matter.



Siren -e %%Xddd-%%Xfs-00MAS-%%N1.%%e -s img_*.jpg -d %1 -f *.* -r -q
Siren -e %%Xddd-%%Xfs-00MAS-%%N1.%%e -s img_*.jpg -d X:\Very\Very\LongPath -f *.* -r -q

Siren -r -q -e %%Xddd-%%Xfs-00MAS-%%N1.%%e -s img_*.jpg -d %1 -f *.*
Siren -r -q -e %%Xddd-%%Xfs-00MAS-%%N1.%%e -s img_*.jpg -d X:\Very\Very\LongPath -f *.*


.

68

(6 replies, posted in Evolution requests)

Ahh, i thought i can use Siren inside the FOR loop to rename the folders.

For Each %D In Folders (
    launch Siren.exe to rename %D
)

No?

-

But just for "to capitalize names of a whole directory tree" an Visual Basic or Java Script will do.
It's better in handling code pages too for non-english (non-ASCII 7) names then an batch.
That can be done by utilizing the FileSystemObject.

I am not an coder, but something like this should work:

TEST WITH COPIES OF YOUR FILES ONLY  smile

'Rename all Folder and/or files to lower or upper case
'=======================================================


'USER SETTINGS:
'sPath is top folder to start the renaming
'sCase is an switch to change case to UPPER or lower case
sPath = "c:\TEMPO\Test vbs rename\"
sCase = "UPPER"


'Call the renaming:
RecurseFolders sPath, sCase
MsgBox "Finished"


'THE CODE:
Sub RecurseFolders(sPath, sCase)
    IF (LCASE(sCase) <> "lower" AND LCASE(sCase) <> "upper") Then
      MsgBox "Please use ""lower"" or ""upper"", but not """ _
              & sCase & """ !" & vbCRLF & "Script end here."
      Exit Sub
    End IF
    
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set FLDs = FSO.GetFolder(sPath)
    
    For each folder in FLDs.SubFolders
      Set oFldr = FSO.GetFolder(folder)
      
        'RENAME FOLDERS:
          OLDname = oFldr.Name
          oFldr.Name = OLDname & "-"
          IF (LCASE(sCase) = "lower") Then oFldr.Name = LCase(OLDname)
          If (LCASE(sCase) = "upper") Then oFldr.Name = UCase(OLDname)
        
        'RENAME FILES:
         ' For Each file In oFldr.Files
         '   OLDname = file.Name
         '   file.Name = OLDname & "-"
         '   IF (LCASE(sCase) = "lower") Then file.Name = LCase(OLDname)
         '   If (LCASE(sCase) = "upper") Then file.Name = UCase(OLDname)
         ' Next
    
       IF FLDs.SubFolders.Count > 0 Then
          RecurseFolders folder.Path, sCase
       End if
    Next
End Sub

69

(6 replies, posted in Evolution requests)

Maybe DOS Batch to the aid?

What do you think Rémi? Would that work?

WARNING: this will only work (if then) to change the case of the folder names.
If you would change parts of the name, the path to the sub-folder would not be valid anymore.
We had to modify from the deepest sub-folder to the top folder then.
Should be doable too by reversing the list, but that trick i will only provide if it would work anyway at first :-)



What i had in mind was:

* go to the folder

* get the list of sub-folders:
X:\folder>dir /AD /B /S > Folders.txt

or for english windows
X:\folder>dir /AO /B /S > Folders.txt

(In an DOS-Box use "DIR /?" for an help)




* For Each Folder in Folders.txt run an test:
FOR /F "tokens=*" %D IN ('type Folders.txt') DO @ECHO "%D"
or in an Batch use double %s:
FOR /F "tokens=*" %%D IN ('type Folders.txt') DO @ECHO "%%D"

This should echo the whole path of the sub-folders incl. quotes.

Another example btw:
Use %~nD  to only see the name-part of the sub-folders. for example.
FOR /F "tokens=*" %%D IN ('type Folders.txt') DO @ECHO %%~nD

(In an DOS-Box use "FOR /?" for an help)




* if it works try it with Siren:
FOR /F "tokens=*" %%D IN ('type Folders.txt') DO (
    ...here your Siren command line,  "%%D" will insert one folder name after the other in each loop...
)





umm, an batch again.  .... i should really switch to  powershell  ;-)
Or we can do this by an VBS or JS script...
.

70

(3 replies, posted in How to ...)

Hello Tom, welcome.

It is always an good idea to provide real file names as examples!



Because for your "t01" example
you can just drop the old file name
and build an new one by inserting "t" and
then add an new numbering starting at "24":

Expression: t%n{2,24,1}.tif



"t" is just an literal char "t".
"%n" is an counter in the order the files are selected.
The parameter  {2,24,1} stands for {padding width, start at, step width}

Here are more explanations > http://scarabee-software.net/forum/viewtopic.php?id=269

Ahh, i see. Thanks for the link:

Help: Examples > "Rename associated files while renumbering them"

How does it work ?
An rename expression can be compound of "sub-expressions" separated by ';' (semicolon).
They are evaluated one after another on all the files.

Of course, from the second one all the variables normally associated to the "Current name" (%f, %e, %N ...)
will be related to the "New name" computed by the previous one.

Why adding "%e" at the beginning of the name and remove it just after ?

"%nc" gives a number avoiding collisions without taking into account the following rest of the expression.
In our example the extension has to be part of the collision evaluation.
By creating a temporary one, we will get the expected result.


----

BTW to all, if someone is interested.

Borut wrote:
P:\\=%e=Photo\\_Photo\\

Explanation:
Since the "\"-sign is taken as an meta char  in Siren, we have to escape them by doubling them like "\\".

For your convenience there is an short cut to double the back slashes:

Help > User interface tips > Expression combo shortcuts
  Ctrl+Shift+B doubles the '\' (backslash) present in the selected text

But this works only for selected parts. This bit is overseen often.


Side note, forward slashes "/" will work as path delimiter (like "\") for Windows too and so also in Siren.

72

(11 replies, posted in Evolution requests)

Two ideas:

1.) Siren could first take an look into its own folder to find files.
%b(1,8) %T{"sr_n2a.txt",%nc{1,0}}.*


2.) Siren could set an own user-system-variable %SirenPath% which can be accessed with ${SirenPath}

But i have tested that with an batch

@ECHO OFF
SET SiPath=%~dp0
ECHO SiPath: %SiPath%
START siren
PAUSE

SiPath: X:\Path\Siren3\

%b(1,8) %T{"${SiPath}sr_n2a.txt",%nc{1,0}}.*

and it seems i have no success
since i need doubled back slashes for such variables like %T,
but the system var only contains single back slashes.

Also i didn't had success with
%b(1,8) %T{"${UserProfile}sr_n2a.txt",%nc{1,0}}.*
due the same issue.


-----------

Maybe:
Can i set e.g. an favorite who search&replace in an system variable string?
${UserProfile}("\","\\")

Or an other convention like $${var} with doubled back slashes?


But then even this advanced batch didn't succeed:

@ECHO OFF
SET SiPath=%~dp0
SET SiPath=%SiPath:\=\\%
ECHO SiPath is set to: %SiPath%
START siren
PAUSE

SiPath is set to: X:\\Path\\Siren3\\

%b(1,8) %T{"${SiPath}sr_n2a.txt",%nc{1,0}}.*


It seems the var is not expanded in that expression?
And i guess there is no eval() command?
%b(1,8) %T{eval(${SiPath}) + "sr_n2a.txt",%nc{1,0}}.*

-----------



BTW, i am talking about Win32 Windows here.


---------------

EDIT:

I found an work around:


Start Siren from an batch like this

start.CMD

@ECHO OFF

SUBST B: %CD%
START siren

Now the current folder of Siren is accessible by B: too.
Now use
%b(1,8) %T{"b:\\sr_n2a.txt",%nc{1,0}}.*


This B: mapping is valid till an pc restart
or till you give the command
subst b: /d

Or use an batch like

SUBST B: %CD%
START /wait siren 
subst B: /D

which do that automatically.
The drawback is, the command window will stay open till you close Siren.


.

Borut wrote:

But this does not:

%e=P:\\Photo\\_Photo\\

An leading %e before the drive letter makes no sense.
What path would that be?

%e=P:\\Photo\\_Photo\\
JPG=P:\Photo\_Photo\


I only can imagine smtg like:
P:\\%e=\\Photo\\_Photo\\
P:\JPG=\Photo\_Photo\

OK  big_smile

How about something like If-Then-Else syntax:

%?( condition ?  true  : false )

%?( %N  ?  Number %N  :  <nothing> )

%?( %N  ?  Number %N  :  0 )


Just an idea i stumbling over while testing.


Example:
File.ext
File1.ext
File2.ext
File3.ext

Expression: %N - %f

Current Result:
- File.ext
1 - File1.ext
2 - File2.ext
3 - File3.ext



With If-Then:

Expression: %?( %N  ?  %N - %f  )
Result:
File.ext
1 - File1.ext
2 - File2.ext
3 - File3.ext


Expression: %?( %N  ?  %N - %f  : 0 - %f )
Result:
0 - File.ext
1 - File1.ext
2 - File2.ext
3 - File3.ext