Script - How To Write File Name In Image

Moderator: Kathy_9

Post Reply
rjw918
Posts: 2
Joined: Sun Sep 04, 2011 10:36 pm
operating_system: Windows XP Pro
System_Drive: C
32bit or 64bit: 32 Bit
motherboard: Dell Computer Corporation
processor: 1.50 gigahertz Intel Pentium M
ram: 1024 MB
Video Card: NVIDIA GeForce FX Go5200
sound_card: SigmaTel C-Major Audio
Hard_Drive_Capacity: 40G
Monitor/Display Make & Model: Insignia DX-19L150A11 [Monitor]

Script - How To Write File Name In Image

Post by rjw918 »

I'm trying to create a script which will write the filename in/on an open image itself

I recorded a script which

draws a rectangle
merges it down
writes/types some words on the rectangle
and merges that down

Rather than type the same thing in each image, I'd like to write the file name instead omto the image

The applicable section of script seems to be:

Code: Select all

    # Text
    App.Do( Environment, 'TextEx', {
[A number of text tool parameters  omitted]

                }, 
            'Join': App.Constants.JointStyle.Miter, 
            'MiterLimit': 10, 
            'Characters': u'File NAme Here?', 
            'Strings': None, 
            'TextTarget': (0,0,[1],True), 
            'PathTarget': None, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((13,0,0),1)
                }
            })
The key line seems to be that: 'Characters': u'File Name Here?',

(the 'File Name Here' was, of course, what I typed in with the Text Tool

And I'm thinking I somehow have to use App.TargetDocument.Title, perhaps as a variable or system variable, but I have not been able to figure out how to do it.

I'm pretty good with WordPerfect's PerfectScript, and can sometimes muddle my way though some JaveScript, but this is beyond my ability

My thanks in advance for any help, as I will be processing thousands of files ovcer time, typically 100-500 at a time....
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Script - How To Write File Name In Image

Post by LeviFiction »

Replace u'File Name Here?' with App.TargetDocument.Title just like you were planning

Code: Select all

'Characters': App.TargetDocument.Title,
If you're having problems with that remember to check your formatting. Python, like any language, is very particular about its formatting and syntax.
https://levifiction.wordpress.com/
Post Reply