#1 (permalink)  
Old 08-05-2009, 09:21 PM
dPS Forum Member
 
Join Date: Jun 2009
Location: Wigan, UK
Posts: 103
Default PSP Scripting - code level...

HI

right, this is a fun one... basically.... i'm trying to do a script that does 3 different versions of the same photo... i have an IR camera and have found 3 different outputs work in different ways - now i know i could have 3 different scripts and run it 3 times on the same pics - but i'm lazy so have spent many hours trying to get this working...

at the moment i can run it on one pic and get the output to a certain folder with 3 different names but the next time i run it on the next photo it over writes the original one and the same if i run a batch

now the specific code part that i know will need to be changed is...

Code:
# Standard PSP entry point - IR Fix
def Do(Environment):

		Optimise(Environment)
		One(Environment)
		SaveAs(Environment,'G:\\Photos\\IR\ A.jpg')
		RtoB(Environment)
		SaveAs(Environment,'G:\\Photos\\IR\ B.jpg')
		RtoG(Environment)
		SaveAs(Environment,'G:\\Photos\\IR\ C.jpg')
if i could tell it save where the file is opened & to use the filename + A, B or C that would be amazing, but i can't find the syntax for the coding...

anyone any ideas? or am i too much of a programmer/geek?
__________________
Site : http://www.pazza.biz
Camera : Canon 5d Mk ii
Reply With Quote
  #2 (permalink)  
Old 08-06-2009, 10:28 AM
wulf's Avatar
Ninja Moderator
 
Join Date: Dec 2006
Location: Oxford, UK
Posts: 9,830
Default

I can't help with the specifics as I haven't used PSP for a decade or more. I assume there must be some method of capturing the name of the original file. If not, perhaps there is a way of adding a user input to the script so that it asks what name you want to use. However you get it, you want to assign a value to a variable and then use that to work out the output names.

Wulf
__________________
Wulf Forrester-Barker << Sites: blog / flickr >>
Gear: Nikon D40, Nikon AFS 18-55mm f/3.5 - 5.6G, Nikon Series E 50mm f/1.8, Nikon AF 70-300mm f/4-5.6G, Vivitar 90mm f/2.5 macro, Raynox DCR-250, Lensbaby 2.0k, SB600
Reply With Quote
  #3 (permalink)  
Old 08-06-2009, 10:42 AM
dPS Forum Member
 
Join Date: Jun 2009
Location: Wigan, UK
Posts: 103
Default

I don't give up too easily and found a little more info today in work...

ReturnImageInfo as a command seems to be able to specify the filename and path, so thats my task for tonight... i also found out it's pretty much python, so something like

filename = ReturnImageInfo('Filename')
SaveAs(Environment,filename.replace('.jpg', 'A.jpg'))

should work hopefully...

i can code in Visual Basic, so what i need to do i know, it's knowing the syntax
i will post the answer if/when sucessful...
__________________
Site : http://www.pazza.biz
Camera : Canon 5d Mk ii
Reply With Quote
  #4 (permalink)  
Old 08-06-2009, 10:59 AM
wulf's Avatar
Ninja Moderator
 
Join Date: Dec 2006
Location: Oxford, UK
Posts: 9,830
Default

That looks promising. I look forward to hearing if it works.

Wulf
__________________
Wulf Forrester-Barker << Sites: blog / flickr >>
Gear: Nikon D40, Nikon AFS 18-55mm f/3.5 - 5.6G, Nikon Series E 50mm f/1.8, Nikon AF 70-300mm f/4-5.6G, Vivitar 90mm f/2.5 macro, Raynox DCR-250, Lensbaby 2.0k, SB600
Reply With Quote
  #5 (permalink)  
Old 08-06-2009, 05:03 PM
dPS Forum Member
 
Join Date: Jun 2009
Location: Wigan, UK
Posts: 103
Default

Woo Hoo

done it...

Code:
# Standard PSP entry point - IR Fix
def Do(Environment):

		ImageInfo = App.Do( Environment, 'ReturnImageInfo',)
		FullPathnFile = ImageInfo['FileName']
		PathnFileA = FullPathnFile.replace('.JPG', 'a.JPG') 
		PathnFileB = FullPathnFile.replace('.JPG', 'b.JPG')
		PathnFileC = FullPathnFile.replace('.JPG', 'c.JPG')

		Optimise(Environment)
		One(Environment)
		SaveAs(Environment,PathnFileA)
		RtoB(Environment)
		SaveAs(Environment,PathnFileB)
		RtoG(Environment)
		SaveAs(Environment,PathnFileC)
__________________
Site : http://www.pazza.biz
Camera : Canon 5d Mk ii
Reply With Quote
  #6 (permalink)  
Old 08-07-2009, 03:23 PM
dPS Forum Member
 
Join Date: Jul 2008
Location: Northern CA
Posts: 133
Default

It appears that code appends the a,b,c to the end of the filename. That right? So if your filename is DSC_9876.JPG then each one becomes DSC_9876a.JPG, DSC_9876b.JPG, etc.

Right?
__________________
Drkranger
Kaymee Photography
Sacramento Photography Examiner
Nikon D300, Nikon D50
Sigma 50-150mm f/2.8, Nikkor 50mm f/1.8
Reply With Quote
  #7 (permalink)  
Old 08-07-2009, 05:48 PM
wulf's Avatar
Ninja Moderator
 
Join Date: Dec 2006
Location: Oxford, UK
Posts: 9,830
Default

That's exactly what it looks to do - just that small change avoids things being overwritten.

Wulf
__________________
Wulf Forrester-Barker << Sites: blog / flickr >>
Gear: Nikon D40, Nikon AFS 18-55mm f/3.5 - 5.6G, Nikon Series E 50mm f/1.8, Nikon AF 70-300mm f/4-5.6G, Vivitar 90mm f/2.5 macro, Raynox DCR-250, Lensbaby 2.0k, SB600
Reply With Quote
  #8 (permalink)  
Old 08-08-2009, 03:08 PM
dPS Forum Member
 
Join Date: Jun 2009
Location: Wigan, UK
Posts: 103
Default

exactly does 3 different things and saves them with a, b & c

some look good with the red colour
some look good a little lighter - a
R to B makes it look pinky/purplely - b
R to G makes it look bluey - c

and then i can work on the ones i like by converting properly and touching up slowly :-)
__________________
Site : http://www.pazza.biz
Camera : Canon 5d Mk ii
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off



Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

What’s Your Preference?

Daily Digest

Each day we send out a quick email to thousands of DPS readers to notify them of updates. This email is just short excerpt of the first few lines of our latest post with a link if you want to read it all. You can unsubscribe from this this service at any time.

This service is provided by a third party (Feedburner) and you can subscribe to it by leaving your email address in the following field and confirming your subscription when you get an email asking you to do so.

Enter your email address for
Daily Updates:

Weekly Summary

For those wanting a weekly summary of what happens on this site this free email newsletter is probably your best option. It includes a summary of the tips posted to the site each week. This newsletter is subscribed to by over 25000 readers (many who also subscribe to the other options above) - come join the community!

To subscribe to this weekly newsletter simply add your email address to the following field and then follow the confirmation prompts. You will be able to unsubscribe at any time.

Enter your email address for
Free Weekly Newsletter:

 
SEO by vBSEO 3.3.0