Peters Flexible RenAmiNg Kit (PFrank) Forum Index Peters Flexible RenAmiNg Kit (PFrank)
Support and Discussion Site for the PFrank File/Folder Renaming Tool (http://www3.telus.net/pfrank)
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Arithmetic and subfolder dependent rule

 
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> Regular Expressions
View previous topic :: View next topic  
Author Message
s31415



Joined: 24 Jan 2009
Posts: 9

PostPosted: Sat Jan 24, 2009 3:27 am    Post subject: Arithmetic and subfolder dependent rule Reply with quote

Hi,

Is it possible to perform arithmetic operations on numbers appearing in filnames ? For instance change
file1.jpg
file2.jpg
file3.jpg
...
to
file2.jpg
file3.jpg
file4.jpg
...
?

Also, how can I create a rule that will be applied only to a specific subfolder ?

Thanks in advance and best regards,

Sam
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 446
Location: Canada

PostPosted: Sat Jan 24, 2009 6:26 am    Post subject: Reply with quote

Yes to both questions.

For the first one you need a plugin. There is already an example plugin called "PFrank_Add1.1ToFirstNumber_Plugin.py".
Just change the code to add 1 instead of 1.1.
The plugin and information on using plugins is at:
http://www3.telus.net/pfrank/PFrankUserCommand.html

Further instructions are in the plugin file.


For the second question, just press the "more' button on the main window. This wil cause the Options window to pop up. In that window you'll find a filter for subfolders. Just set that filter to the subfolder name (or pattern) you want.

If you need more info then let me know.

Peter.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
s31415



Joined: 24 Jan 2009
Posts: 9

PostPosted: Sat Jan 24, 2009 3:32 pm    Post subject: Reply with quote

Thanks you very much ! I'll study this.

Sam
Back to top
View user's profile Send private message
s31415



Joined: 24 Jan 2009
Posts: 9

PostPosted: Sun Jan 25, 2009 5:14 am    Post subject: Reply with quote

Hi again,

Two more questions :

- Is it possible to write plugin with parameters ? For instance a plugin that would add n to the first number appearing in the file, where n would be a number provided by the user in PFrank.

- Concerning subfolder, maybe I misunderstood your answer, but it seems that by setting a filter in the "more" button, this will apply to all the search patterns. I would have liked to have search and replacement patterns that apply to different subfolders... Maybe it is also possible to do this with a plugin ?

Sorry to bore you with such strange renaming requirements... No need to read further, but if you're curious about why I need this, I'm trying to convert in Zoomify (http://www.zoomify.com) an image of size 65536 x 65536 pixels which is broken into 64 8192 x 8192 tiles. Zoomify is a flash plugin which allow you to explore huge images just like in Google Maps by breaking them into 256 x 256 tiles at various scales. Each tile should be named a-b-c.jpg, with a a number representing the scale, b the x coordinate and c the y coordinate. Zoomify provides utility performing this, but it accepts as input only one large image. As my 65536 x 65536 pixel image broken into tiles, and as my computer would die if I tried to assemble these tiles, I have to pass the tiles separately into Zoomify, and rename them appropriately.

Thanks,

Sam
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 446
Location: Canada

PostPosted: Sun Jan 25, 2009 9:19 pm    Post subject: Reply with quote

I'll answer the second question first:
- what you could do is ue the list manager feature (on the main window). With the list manager you can save the custom creator list plus all the filters into a named configuration set. With this you can specify configurations that use different subfolder filters.

For the first question:
GUI or other parameters being passed into a plugin is currenlty not a feature. But you can spoof it by borrowing a parameter that you might not be using. In this case a name filter parameter might work because filter parameters can be saved in a custom set (from (1) above.
For example, you can access the "min path length" parameter from a plugin. The variable is called:
configurator.optionlist[SEARCHREP_OPTIONMINPATHLENGTH_ID]

or maybe use the max subfolder depth parameter:

configurator.optionlist[SEARCHREP_OPTIONMAXSUBFOLDERS_ID]

These variables are both integers and are saved for each custom set. The range of these particular variables are limited (to a max of 512) so I don't know if that will work for you but you can always combine them if you need more range.
It is not an idelal soluton but should work.

I'll think about adding custom variables as a future feature.

Hope this works. If you find some other problem or limitation then let me know.

Peter.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
s31415



Joined: 24 Jan 2009
Posts: 9

PostPosted: Sun Jan 25, 2009 11:37 pm    Post subject: Reply with quote

About the subfolders, I will have one for each of my 64 tiles. In each of them, the renaming pattern should be different. I was wondering if I could avoid hitting 64 times the "scan" button... I may avoid it if I can execute several lists altogether. Is it possible ? But it's only pure laziness... Smile

Passing the parameters through the configurator works well !

Thanks again !

Sam
Back to top
View user's profile Send private message
s31415



Joined: 24 Jan 2009
Posts: 9

PostPosted: Mon Jan 26, 2009 12:03 am    Post subject: Reply with quote

Ah, one more question. How can I access the "max name length" parameter ? The obvious
configurator.optionlist[SEARCHREP_OPTIONMAXNAMELENGTH_ID]
doesn't seem to work...

Sam
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 446
Location: Canada

PostPosted: Mon Jan 26, 2009 2:35 am    Post subject: Reply with quote

The parameter you want is called:
configurator.optionlist[SEARCHREP_OPTIONMAXFILELENGTH_ID]

Are the parent folder names of the tiles related in any way to how you want to rename the files under them. If so there is an 'insert parent folder name' option that might be of use.

Peter.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
s31415



Joined: 24 Jan 2009
Posts: 9

PostPosted: Tue Jan 27, 2009 5:34 am    Post subject: Reply with quote

I will have to think a bit more to see if I can use the name of the folders... But anyway thanks !

Sam
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> Regular Expressions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own Video Sharing Site

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com