Search the web
Sign In
New User? Sign Up
powerpro-beginners · Windows PowerPro For Beginners
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 2218 - 2247 of 2247   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#2247 From: "Sheri" <silvermoonwoman@...>
Date: Sat Nov 28, 2009 7:27 am
Subject: Re: Attn Sheri! How to create global autocomplete?
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, Brother Gabriel-Marie <brgabriel@...>
wrote:
>
> I have problems with the find/replace script. All I did
> was rename the script and rename the function. And I get the
> error even if I quit powerpro and restart it and quite IND and
> restart it too. I know when I first touch off the script that I
> don't already have a com error hanging around. And I have a text
> box selected. And I get the same error in both find/replace
> scripts (I like the first one because it will do the whole
> document)
>
> ERROR: com.method: Invoke failed  (sys code 80020009: "Exception occurred.")
> Error occurred near line 204 of script InDesignFindReplace@ReplaceSelection:
>                 local
> r=myselect.Search(chgVec[i,1],wholeword,casesensitive,chgVec[i,2])

Without seeing the code you're running, and also without CS3 reference material,
its hard for me to help. You should probably zip and post your current version
of the scripts together with the version 5 Resources for Visual Basic.tlb file
so I can see them. If a test document from CS3 will load in CS2, include one of
those too.

I don't think the Search function exists in version 5/CS3. I don't know what
they did instead. I think that by using the compatibility setting

appRef.ScriptPreferences.Version = 4

you allow the older version syntax to work on version 5. If you have that line
commented out for the find/replace scripts, uncomment it. It may allow the
replaces to work without errors. To be honest, I don't understand how it could
be that in spite of invoke errors, it could still process replacements after
pressing "OK".

Also, the original script, which processed replaces everywhere, ought to be
targeting apRef.ActiveDocument instead of appRef for its
uses of the Search function. And CS3 should alsways be part of your server name.

> #Issue#=201
> #Year#=2010
> #Month#=January
> #MON#=JAN
> #Intentions#=For our priests - In particular for ones enduring persecution
> #TRMONTH#=October
> #tm1#=SEP
> #tm2#=OCT
>
> I tried shortening the replace words to just one word (instead of a
> sentence, as for #intentions#) but the same error appeared.

The length of the replace words doesn't matter.

> Now, if I "okay" through the errors, the ReplaceAll script will
> indeed make the replacements, but it gives me all the errors. The
> ReplaceSelection script works too if I okay through all the
> errors. I have no idea!

Might as well Cancel when it is failing and shut down Powerpro. Then check your
running processes and kill any existing Powerpro processes. That can happen if
the com plugin has unreleased objects and is not properly unloaded. Then restart
Powerpro.

Regards,
Sheri

#2246 From: Brother Gabriel-Marie <brgabriel@...>
Date: Fri Nov 27, 2009 11:52 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
brother.gabriel
Offline Offline
Send Email Send Email
 
Hello, Sheri!

Well, I am trying to get InDesign to open a template (this works) but
then I have problems with the find/replace script.
All I did was rename the script and rename the function.  And I get the
error even if I quit powerpro and restart it and quite IND and restart
it too.  I know when I first touch off the script that I don't already
have a com error hanging around.  And I have a text box selected.
And I get the same error in both find/replace scripts (I like the first
one because it will do the whole document)

ERROR: com.method: Invoke failed  (sys code 80020009: "Exception occurred.")
Error occurred near line 204 of script InDesignFindReplace@ReplaceSelection:
                 local
r=myselect.Search(chgVec[i,1],wholeword,casesensitive,chgVec[i,2])

Here is my function call:
.InDesignFindReplace@ReplaceSelection(?"C:\Saint Cuthbert\Eucharistic
Crusade\Hostia\Hostia 201 Jan\Tokens.ini", 1, 0, 0, 0)

Here is the contents of my Tokens.ini file:

#Issue#=201
#Year#=2010
#Month#=January
#MON#=JAN
#Intentions#=For our priests - In particular for ones enduring persecution
#TRMONTH#=October
#tm1#=SEP
#tm2#=OCT

I tried shortening the replace words to just one word (instead of a
sentence, as for #intentions#) but the same error appeared.
Now, if I "okay" through the errors, the ReplaceAll script will indeed
make the replacements, but it gives me all the errors.  The
ReplaceSelection script works too if I okay through all the errors.  I
have no idea!

#2245 From: Brother Gabriel-Marie <brgabriel@...>
Date: Fri Nov 27, 2009 4:31 pm
Subject: Re: Come and InDesign
brother.gabriel
Offline Offline
Send Email Send Email
 
Alright!  Thanks again!  In order not to have to remember the script
language over and over, I put the scriptlanguage part into a function
that I can reuse.  It works!  But if I wanted to use vbs, what is the
script language id for that?

Function RunScript(whatscript, scriptlanguage)
     .@ComLoad()
     appRef.DoScript(whatscript, .@ScriptType(scriptlanguage))
     .@ComUnload()
     quit

Function ScriptType(scriptlanguage)
     if (scriptlanguage=="js") or (scriptlanguage=="jsx")do
         quit(1246973031)    ;;idJavascript
     elseif (scriptlanguage=="vbs")do
         quit("")
     Endif
     quit

#2244 From: "Sheri" <silvermoonwoman@...>
Date: Fri Nov 27, 2009 6:26 am
Subject: Re: Come and InDesign
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
>
> This works for me:
> local idScriptLanguage=1246973031 ;;idJavascript
> appRef.DoScript(myJavaScript, idScriptLanguage)
>
> You could also use the value directly in the call, e.g.,
> appRef.DoScript(myJavaScript, 1246973031)

My function btw was

Function RunScript(myJavaScript)
not
Function RunScript(whatscript)

You should enable the Powerpro configuration option on the "Other" tab of
Advanced Options "Variables must be declared before using".

Regards,
Sheri

#2243 From: "Sheri" <silvermoonwoman@...>
Date: Fri Nov 27, 2009 2:05 am
Subject: Re: Come and InDesign
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, Brother Gabriel-Marie <brgabriel@...>
wrote:
>
> I am trying to figure this "RunScript" function: (watch for wordwrap)

[...]
>
> Function RunScript(whatscript);;<--THIS ONE!
> .@ComLoad()
> appRef.DoScript myJavaScript, idScriptLanguage.idJavascript, arguments[0])
> .@ComUnload()
> quit
> ----------------------------------
>
> .InDesign@RunScript(?"C:\Saint Cuthbert\Programming\Adobe
> Scripting\Adobe InDesign CS3\BGMscripts\testscript.jsx")

That should run it. If you put some messageboxes or debugs into the function you
should see them and be assured it is running.

This line is wrong:

> appRef.DoScript myJavaScript, idScriptLanguage.idJavascript, arguments[0])

Some of the problems:
1. no open parenthesis
2. you need the value not the name for idnames used in vbscripts and powerpro
3. There is no variable named arguments[0]

This works for me:
local idScriptLanguage=1246973031 ;;idJavascript
appRef.DoScript(myJavaScript, idScriptLanguage)

You could also use the value directly in the call, e.g.,
appRef.DoScript(myJavaScript, 1246973031)

Regards,
Sheri

#2242 From: Brother Gabriel-Marie <brgabriel@...>
Date: Wed Nov 25, 2009 5:32 pm
Subject: Re: Come and InDesign
brother.gabriel
Offline Offline
Send Email Send Email
 
Wow!  I never knew about TLviewer!  I found CS3 with version 5 and it
loaded up just fine.  I have been struggling with the Extendscript
toolkit, but it doesn't seem to help me find what I am looking for, so I
look through the CS3 Adobe scripting pdfs (pdfs!  Why can't we get a chm
file?)  The ESTK is confusing.  I just realized that vbs is using com
scripting too.  But it is not quite the same as PP com scripting,
right?  Are they much different?

Much of my work involves using Indesign, and I have fallen in love with
Powerpro; it seems like the logical thing to do in order to improve my
workflow is to learn to script adobe.  I wish I weren't so hard headed!

The reason I had altered the code line was that NextItem didn't work so
I was trying other possibilities.  I noticed the new release of the com
plugin and installed it.  Also, I have been pushing cancel on the com
errors, and my PP has been crashing a lot.  I had taken to unloading the
com plugin and saw it helped things; but I will push ok as per your
advice.

After I installed the new com plugin, the script works fine!
I am trying to figure this "RunScript" function: (watch for wordwrap)
----------------------------------
Function ComLoad() ;;MAKE SURE TO CALL .@Finish WHEN EXITING FUNCTION CALLS!
	 global idscriptver=file.version(win.exepath(INDE))[0]
	 global csvermap=map.create(3, 1)
	 csvermap[4]="CS2"
	 csvermap[5]="CS3"
	 csvermap[6]="CS4"
	 global csver=csvermap[idscriptver]
	 global objname="InDesign.Application."++csver
	 global com_status, com_type
	 global appRef=com.create_object(objname)
	 ;appRef.ScriptPreferences.Version = 4
Function ComUnload();;this is end the com calls and unload com
	 appRef.Release
	 com.unload
	 quit

Function RunScript(whatscript);;<--THIS ONE!
.@ComLoad()
appRef.DoScript myJavaScript, idScriptLanguage.idJavascript, arguments[0])
.@ComUnload()
quit
----------------------------------
Here are my call attempts:
.InDesign@RunScript("C:\Saint Cuthbert\Programming\Adobe Scripting\Adobe
InDesign CS3\BGMscripts\testscript.jsx")

.InDesign@RunScript(?"C:\Saint Cuthbert\Programming\Adobe
Scripting\Adobe InDesign CS3\BGMscripts\testscript.jsx")

.InDesign@RunScript(/c/Saint Cuthbert/Programming/Adobe Scripting/Adobe
InDesign CS3/BGMscripts/testscript.jsx")

The error returned says it can't load the plugin due to an invalid period...
Are the vbs scripts case sensitive like javascript?

I know all about the keyboard commands for IND.  I wanted to use the com
to do the same job because sometimes IND forgets which keyboard
configuration I was using.  It also forgets what workspace I was using
too.  I set it and save it all the time!  IND will start up
non-maximized in the default workspace and default key configuration, so
I try to remedy that with PowerPro.

Thanks again for your help!
-- Brother Gabriel-Marie

#2241 From: "Sheri" <silvermoonwoman@...>
Date: Tue Nov 24, 2009 7:04 pm
Subject: Re: Come and InDesign
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, Brother Gabriel-Marie <brgabriel@...>
wrote:
>
> I won't die from having to use the menu bar.

You know InDesign has keyboard shortcuts for Next/Prev Window, right?

Ctrl+F6 or Ctrl+~ [tilde]
Shift+Ctrl+F6 or Ctrl+Shift+~ [tilde]

> On the other hand, if you are interested and
> willing, do please continue! I don't think I will be of much help
> however, because I don't know nearly enough scripting in either
> language. Anyways, here is the error:
>
> ERROR: com.method: Invoke failed
> Error occurred near line 74 of script InDesign@NextWindow:
>     local next=appRef.Windows.next(first)
> Press Cancel to end all running scripts.
>

When you get a com plugin invoke error, you should probably click "OK" instead
of "Cancel". If you cancel, the rest of the script is skipped and objects and
com plugin don't get removed from memory.

Appears you've altered the script line.

   it should be:
local next=appRef.Windows.NextItem(first)
   not:
local next=appRef.Windows.next(first)

I don't know what kind of documentation you're working with. You need to be
looking at the CS3 objects and methods used for VBScript. For CS2 there is a
mammoth pdf file. I am also able to use the object browser of a visual basic
script editor as well as TLViewer which is referenced in the com plugin
documentation.

For TLViewer, you can download and upzip
<http://www.tlviewer.org/tlviewer/TLVOB6.zip> and try TLViewer.exe. If it gives
an error, download and unzip <http://www.tlviewer.org/tlviewer/TLBINF32.zip>

Register the dll by running from the windows command prompt:

regsvr32 tlb32inf.dll

Then retry TLViewer.exe. If you can't find InDesign in the listing you may have
to browse to a support file. For CS2 I found it at

C:\Documents and Settings\All Users\Application Data\Adobe\InDesign\Version
4.0\Scripting Support\4.0\Resources for Visual Basic.tlb

When I browse to to the IndDesign "Windows" object, I can see NextItem (but not
"next") and other methods, etc., that are valid for appRef.Windows.

Regards,
Sheri

#2240 From: Brother Gabriel-Marie <brgabriel@...>
Date: Sun Nov 22, 2009 9:19 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
brother.gabriel
Offline Offline
Send Email Send Email
 
Wow!  Hey that sure makes things easy!  And it works too!  Wonderful!

#2239 From: Brother Gabriel-Marie <brgabriel@...>
Date: Sun Nov 22, 2009 8:24 pm
Subject: Re: Come and InDesign
brother.gabriel
Offline Offline
Send Email Send Email
 
Dear Sheri,
Well, I tried that and it didn't work on either CS2 or CS3 with the
version line commented or uncommented.  This is tricky stuff, I think!
I saw the threads about the com_invokes in the main forum - whew!  I
didn't know it was so complicated.  I sure appreciate your help, but I
understand if you begin to grow tired and don't want to deal with it
anymore.  I won't die from having to use the menu bar.  On the other
hand, if you are interested and willing, do please continue!  I don't
think I will be of much help however, because I don't know nearly enough
scripting in either language.  Anyways, here is the error:

ERROR: com.method: Invoke failed
Error occurred near line 74 of script InDesign@NextWindow:
     local next=appRef.Windows.next(first)
Press Cancel to end all running scripts.

#2238 From: "Sheri" <silvermoonwoman@...>
Date: Sun Nov 22, 2009 12:06 am
Subject: Re: Come and InDesign
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, Brother Gabriel-Marie <brgabriel@...>
wrote:
>
> Hello y'all!  What am I doing wrong here?  I don't know com nor
> extendscript well enough to get it.
>
> ;I am trying to discover the script equivalent of setting keyboard
> shortcuts to "View-Navigation" and "Next Window"
> Function NextWindow()     ;;select the next open document window
>     global com_status, com_type
>     global appRef = com.create_object("InDesign.Application")
>     appRef.documents.nextitem(document)
>     appRef.Release
>     com.unload
>     quit

This works for me. Uncomment the version line if it doesn't work in your CS3.

Regards,
Sheri

Function NextIdWindow()
local idscriptver=file.version(win.exepath("=Indesign"))[0]
local csvermap=map.create(3, 1)
csvermap[4]="CS2"
csvermap[5]="CS3"
csvermap[6]="CS4"
local csver=csvermap[idscriptver]
local objname="InDesign.Application."++csver
local com_status, com_type
local appRef=com.create_object(objname)
;appRef.ScriptPreferences.Version = 4
local first=appRef.ActiveWindow
local next=appRef.Windows.NextItem(first)
next.BringToFront
appRef.Release
com.unload
quit

#2237 From: Brother Gabriel-Marie <brgabriel@...>
Date: Sat Nov 21, 2009 5:03 pm
Subject: Come and InDesign
brother.gabriel
Offline Offline
Send Email Send Email
 
Hello y'all!  What am I doing wrong here?  I don't know com nor
extendscript well enough to get it.

;I am trying to discover the script equivalent of setting keyboard
shortcuts to "View-Navigation" and "Next Window"
Function NextWindow()     ;;select the next open document window
     global com_status, com_type
     global appRef = com.create_object("InDesign.Application")
     appRef.documents.nextitem(document)
     appRef.Release
     com.unload
     quit

Thanks for the help!
- Brother Gabriel-Marie

#2236 From: "Sheri" <silvermoonwoman@...>
Date: Sat Nov 21, 2009 7:08 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:

>
> The "Unicode code point" for accented ae is 01FD. (The proper
> character did not appear in your message btw).
>
> We'll see. No, unless Alan can make the com plugin capable of
> sending unicode strings that InDesign's com interface can use.

Good news. I found a way to do it without using unicode file input. Use a normal
file. Put your unicode code points in angle brackets in the normal search or
replacement strings.

For example:

ae=<01fd>

<01fd> is treated by Indesign as a character. It doesn't have to be the whole
replacement string. You can have other characters including other <code points>
in a string. e.g.: abcd<01fd>efg

Regards,
Sheri

#2235 From: "Sheri" <silvermoonwoman@...>
Date: Sat Nov 21, 2009 4:32 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, Brother Gabriel-Marie <brgabriel@...>
wrote:
>
>
> Yesterday I installed the most recent com plugin version 0.67. I
> changed

I have been using latest test .70 version. It is in the main list Files folder
Files > 0_TEMP_ > AlansPluginProvisional

>
> Now both you your scripts work and so does my little startup script.
> I don't know why, but it doesn't try to load CS2 anymore.
> The first replace script however, necessitates, as you mentioned, to
> have *some* text selected in the document.

I think the first script attempt replaces in all documents without regard to the
presence of a selection.

> The second script is wonderful!

Glad it worked :)

> And I learned from you now how to script InDesign using Powerpro.
>
>
> ;This script maximizes InDesign and then sets the First Workspace, which
> is called BGM in the menu
> Function Startup()
> wait.for (300) ;;wait until InDesign is fully loaded
> win.maximize("Adobe InDesign CS*")
> local com_status, com_type
> local appRef = com.create_object("InDesign.Application")
> appRef.menuActions.item("BGM").invoke()
> appRef.Release
> com.unload
> quit
>

Interesting. I'm not finding menuActions in my CS2 docs. Might have been new in
CS3.

>
> Okay, now how do we use a unicode text file for replacement? I
> need to be able to replace "ae" with "ǽ" (accented ae). It is
> Unicode 0x01FD or code point 509. I have created a find/replace
> list in Unicode format (in Notepad++) with this character. I
> think it should be possible to find/replace unicode using the
> unicode plugin? No?

The "Unicode code point" for accented ae is 01FD. (The proper character did not
appear in your message btw).

We'll see. No, unless Alan can make the com plugin capable of sending unicode
strings that InDesign's com interface can use.

The rest of the script would also need to be changed, i.e., to read and process
a unicode file instead of a normal file. But those parts should be doable with
the existing unicode plugin.

> Also, I added another parameter to the main
> function, called showlog, giving the option whether or not to
> display the log file. if (showlog == 1) or (showlog == "")do do
> ("C:/Program Files/notepad2/Notepad2.exe", logfilename) endif
>
>
> Thanks for all your help and your work. I appreciate it. Someday
> maybe I'll make something that will help you too.

You're welcome. I enjoy trying to do this kind of stuff. Not always successful,
but happy when it works.

Regards,
Sheri

#2234 From: Brother Gabriel-Marie <brgabriel@...>
Date: Fri Nov 20, 2009 7:30 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
brother.gabriel
Offline Offline
Send Email Send Email
 
Okay! The first time I ran the script it worked just fine. The first
time I ran the first script it also worked just fine. The error seems to
happen after I have run the script once. I created also this script,
which ran fine the first time but would not run again after that without
giving that same failure to invoke com error. BUT! Keep reading!

Yesterday I installed the most recent com plugin version 0.67. I changed
if (not anywindow("=Indesign") or btrialrun==1) do
to
if (not anywindow("=InDesign") or btrialrun==1) do

because that is how CS3 lists under winspy, but it still gave the error.
So I restarted PowerPro, and I suppose it reloaded the new com pluging.
Now both you your scripts work and so does my little startup script.
I don't know why, but it doesn't try to load CS2 anymore.
The first replace script however, necessitates, as you mentioned, to
have *some* text selected in the document.
The second script is wonderful!
And I learned from you now how to script InDesign using Powerpro.


;This script maximizes InDesign and then sets the First Workspace, which
is called BGM in the menu
Function Startup()
wait.for (300) ;;wait until InDesign is fully loaded
win.maximize("Adobe InDesign CS*")
local com_status, com_type
local appRef = com.create_object("InDesign.Application")
appRef.menuActions.item("BGM").invoke()
appRef.Release
com.unload
quit


Okay, now how do we use a unicode text file for replacement? I need to
be able to replace "ae" with "ǽ" (accented ae). It is Unicode 0x01FD or
code point 509. I have created a find/replace list in Unicode format (in
Notepad++) with this character. I think it should be possible to
find/replace unicode using the unicode plugin? No?
Also, I added another parameter to the main function, called showlog,
giving the option whether or not to display the log file.
if (showlog == 1) or (showlog == "")do
do ("C:/Program Files/notepad2/Notepad2.exe", logfilename)
endif


Thanks for all your help and your work. I appreciate it. Someday maybe
I'll make something that will help you too.
- Brother Gabriel-Marie

#2233 From: "srikat77" <srikat@...>
Date: Thu Nov 19, 2009 1:58 am
Subject: Re: [ppro-b] Question about the main default bar
srikat77
Offline Offline
Send Email Send Email
 
I changed it to floating and set 'Show if bump' to none.

I moved the bar to the center of screen and now I can bring it whenever I want
by pressing the hotkey.

Having the bar at the mouse position is not really important.

Tyvm.

--- In powerpro-beginners@yahoogroups.com, Carroll Robbins <carrollrobbins@...>
wrote:
>
> In PowerPro-Beginners, "srikat77" <srikat@...> wrote, on Wed, 18 Nov
> 2009 18:24:41 -0000:
>
> >The current position of the bar is 'Fixed top center'. Should this be
something else in this case?
>
> Yes, you should change it to Floating.
> --
> Carroll B. Robbins, Jr.
>

#2232 From: Carroll Robbins <carrollrobbins@...>
Date: Thu Nov 19, 2009 12:01 am
Subject: Re: [ppro-b] Question about the main default bar
Carroll_Robbins
Offline Offline
Send Email Send Email
 
In PowerPro-Beginners, "srikat77" <srikat@...> wrote, on Wed, 18 Nov
2009 18:24:41 -0000:

>The current position of the bar is 'Fixed top center'. Should this be something
else in this case?

Yes, you should change it to Floating.
--
Carroll B. Robbins, Jr.

#2231 From: Sheri <silvermoonwoman@...>
Date: Wed Nov 18, 2009 11:36 pm
Subject: Re: [ppro-b] Re: Attn Sheri! How to create global autocomplete?
silvermoonwo...
Offline Offline
Send Email Send Email
 
Brother Gabriel-Marie wrote:
> Well, I tried the script again but it won't work now.  Yesterday I was
> trying to understand how the CustomClipKeys worked and so maybe I messed
> up something somewhere in my pp configuration.  When I run the
> find-replace script now, I get this error (followed by all the errors
> caused by this one...).
>
> ERROR: com.method: Invoke failed
>
> Error occurred near line 72 of script Latin@IndesignReps:
>             local
> r=appRef.Search(chgVec[i,1],wholeword,casesensitive,chgVec[i,2])
>
> Press Cancel to end all running scripts.
>
Please give more information when you post. I don't know if you were
trying it in ID2 or ID3, including or excluding the previously proposed
changes.

Sometimes if you encouter errors, you need to restart Powerpro prior to
retrying.

Try this revision.

You should have either CS2 or CS3 open, preferably with selected text
(but also works with one text frame selected -- at least with CS2). To
process all text in a story, get an insertion point and then use Select
All from the InDesign menu. Or use the Story Editor and Select All.

Function Repl_for_Indesign(chgfile, wholeword, casesensitive, btrialrun)
local logfilename=pprofolder++?"IndesignReplacementScript.log"
if (not anywindow("=Indesign") or btrialrun==1) do
   messagebox("OK", "InDesign Replacements trial run.")
   btrialrun=1
elseif (not btrialrun)
   local idscriptver=file.version(win.exepath("=Indesign"))[0]
   local csvermap=map.create(3, 1)
   csvermap[4]="CS2"
   csvermap[5]="CS3"
   csvermap[6]="CS4"
   local csver=csvermap[idscriptver]
   local objname="InDesign.Application."++csver
   local a =messagebox("OKCancel", ;;+
     "InDesign version: "++csver++"\n"++ ;;+
     "InDesign Replacements to be processed:\n"++ ;;+
     "ChgFile: "++chgfile++"\n"++ ;;+
     "WholeWord: "++wholeword++"\n"++ ;;+
     "CaseSensitive: "++casesensitive++"\n")
   if (a == 0)
     quit
   local com_status, com_type
   local appRef=com.create_object(objname)
   appRef.ScriptPreferences.Version = 4
   appRef.FindPreferences = 1851876449
   appRef.ChangePreferences = 1851876449
   if (appRef.Documents.Count < 1) do
     messagebox("OK", "Error: No Documents Loaded in InDesign", ;;+
     case("title",scriptname))
     appRef.Release
     com.unload
     quit
   endif
   ;win.debug("appRef.Selection.Count",appRef.Selection.Count)
   local msgtext="in InDesign prior to using this script."
   if (appRef.Selection.Count lt 1) do
     messagebox("OK", ;;+
     "Error: Please select text or a text frame " ++ msgtext, ;;+
     case("title",scriptname))
     appRef.Release
     com.unload
     quit
   elseif (appRef.Selection.Count gt 1)
       messagebox("OK", ;;+
     "Error: Please select text or ONE text frame " ++ msgtext, ;;+
     case("title",scriptname))
     appRef.Release
     com.unload
     quit
   else
     Exec.OnError("none")
     ;win.debug("length",appRef.Selection.Item(1).Length)
     if (appRef.Selection.Item(1).Length==0) do
       messagebox("OK", ;;+
     "Error: Length is zero, please select text " ++ msgtext, ;;+
     case("title",scriptname))
     appRef.Release
     com.unload
     quit
     endif
   endif
   Exec.OnError("display")
   local myselect=appRef.Selection.Item(1)
endif
local chgread=file.readall(chgfile)
local chgpat=regex.pcrecompile(?"(?m)^([^;\r\n][^=\r\n]*)=(.+)$")
local chgcount=chgpat.pcrematchcount(chgread)
if (chgcount==0) do
   messagebox("no change records found, quitting")
   quit
else
   local logfile = File.Open(logfilename, "a")
   logfile.writeline("")
   if (btrialrun) do
     logfile.writeline("Trial Run "++formatdate("MM/dd/yyyy ", ;;+
       date.today)++formattime("hh:mm:ss", time) ++ ;;+
       " wholeword: "++ wholeword++ ;;+
       " casesensitive: "++casesensitive)
   else
     logfile.writeline("Live Run "++formatdate("MM/dd/yyyy ", ;;+
       date.today)++formattime("hh:mm:ss", time) ++ ;;+
       " wholeword: "++ wholeword++ ;;+
       " casesensitive: "++casesensitive)
   endif
   logfile.writeline(chgcount++" change spec(s) found in "++chgfile)
   if (btrialrun)
     logfile.writeline("Replacement commands created:")
endif
local chgVec=vec.create2D(chgcount, 3)
chgpat.pcrematchall(chgread,"",chgvec)
for (local i=0;i<chgcount;i++)
   logfile.writeline(?"  AppRef.Search("++ ;;+
     "\x22"++chgVec[i,1]++"\x22"++ ;;+
     ?","++wholeword++?","++casesensitive++ ;;+
     ?","++"\x22"++chgVec[i,2]++"\x22)")
   if (not btrialrun) do
     local r=myselect.Search(chgVec[i,1],wholeword,casesensitive,chgVec[i,2])
     logfile.writeline("  "++r.count++" Replacements Processed "++ ;;+
       formattime("hh:mm:ss", time))
     r.Release
   endif
endfor
if (not btrialrun) do
   logfile.writeline("Processing completed at " ++ ;;+
     formattime("hh:mm:ss", time))
   appRef.Release
   com.unload
endif
logfile.close
do ("notepad.exe", logfilename)
quit

#2230 From: Brother Gabriel-Marie <brgabriel@...>
Date: Wed Nov 18, 2009 5:00 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
brother.gabriel
Offline Offline
Send Email Send Email
 
Well, I tried the script again but it won't work now.  Yesterday I was
trying to understand how the CustomClipKeys worked and so maybe I messed
up something somewhere in my pp configuration.  When I run the
find-replace script now, I get this error (followed by all the errors
caused by this one...).

ERROR: com.method: Invoke failed

Error occurred near line 72 of script Latin@IndesignReps:
             local
r=appRef.Search(chgVec[i,1],wholeword,casesensitive,chgVec[i,2])

Press Cancel to end all running scripts.

#2229 From: "srikat77" <srikat@...>
Date: Wed Nov 18, 2009 6:24 pm
Subject: Question about the main default bar
srikat77
Offline Offline
Send Email Send Email
 
I have added items to the default bar and it stretches horizontally across the
screen from left to right.

I want this bar to appear at the current mouse location when a hot key (Win+`)
is pressed.

These are my current settings:

1. Unchecked 'Auto show as bar' in 'Command Lists' tab.

2. Created a new entry in 'Key/Mouse' tab to have Win+` HideShow the main bar

In spite of this, the bar is always appearing at the top of my screen.

Please let me know how I can have this bar appear/hide at current mouse location
only when the hotkey is pressed.

The current position of the bar is 'Fixed top center'. Should this be something
else in this case?

#2228 From: "Sheri" <silvermoonwoman@...>
Date: Wed Nov 18, 2009 2:08 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
>
>
> One problem at a time but ... does it hurt anything to just let it run on the
whole document?
>

FWIW, I have figured out how to confine it to a selection. Will post revised
script if interested.

Regards,
Sheri

#2227 From: "Sheri" <silvermoonwoman@...>
Date: Mon Nov 16, 2009 10:58 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, Brother Gabriel-Marie <brgabriel@...>
wrote:
>
> Well, I tried the script you prepared for me; I put it on a
> button on my InDesign PP Toolbar. But when I click it, it won't
> run in my IND3, instead it starts the old IND2. Now I tried the
> script with IND2 open and it works in IND2.

I don't have access to CS3. Try changing this line:

local appRef = com.create_object("InDesign.Application")

to

local appRef = com.create_object("InDesign.Application.CS3")

Try it again with that change.

If it still doesn't work properly in CS3, add this line just under the above
line (as altered for CS3):

appRef.ScriptPreferences.Version = 4.0

Try it again.

> The next problem is
> that it runs the replacements on the whole IND document instead
> of just the selected text or the selected story.

One problem at a time but ... does it hurt anything to just let it run on the
whole document?

Regards,
Sheri

#2226 From: Brother Gabriel-Marie <brgabriel@...>
Date: Mon Nov 16, 2009 8:44 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
brother.gabriel
Offline Offline
Send Email Send Email
 
Well, I tried the script you prepared for me; I put it on a button on my
InDesign PP Toolbar.  But when I click it, it won't run in my IND3,
instead it starts the old IND2.  Now I tried the script with IND2 open
and it works in IND2.  The next problem is that it runs the replacements
on the whole IND document instead of just the selected text or the
selected story.  Otherwise, however, the script works!

- Brother Gabriel-Marie

#2225 From: "RG" <rezagmail@...>
Date: Thu Nov 5, 2009 10:06 pm
Subject: powerpro google wave
rezagmail
Offline Offline
Send Email Send Email
 
Those of you who are using it or will be using it. I started a public wave for
powerpro.
To find it type "with:public powerpro" without the quotes in the google wave
search bar :)

#2224 From: "ginnieg23" <ginnieg23@...>
Date: Thu Nov 5, 2009 11:15 am
Subject: Re: How to auto-click QTTabBar tab with mouse hover?
ginnieg23
Offline Offline
Send Email Send Email
 
Thanks I will try it

--- In powerpro-beginners@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
>
> --- In powerpro-beginners@yahoogroups.com, "ginnieg23" <ginnieg23@> wrote:
> >
> > Hi, after alot of time reading the help file
> > and trying the demos, I still can't figure out
> > how to modify an already existing Windows program.
> >
> > I use QTTabBar 1.2.3 Beta5 on XP_Pro_sp3 to modify Windows Explorer, and
would eliminate alot of wrist/finger pain if I could configure PowerPro to auto
Left click the folder tabs when I hover over them with my Logitech mouse.
> >
> > Could anyone please help me understand how to configure this?
> > Thank you very much ...
> >
>
> If there is something unique you can detect when the app's folder tabs is
under the mouse, you could have a script constantly testing every few seconds
for that condition. When conditions are right, the script could send a left
click to the mouse coordinates.
>
> You could start by using *Exec WindowInfo and see what it says when the mouse
is over a folder tab.
>
> Regards,
> Sheri
>

#2223 From: "Sheri" <silvermoonwoman@...>
Date: Wed Nov 4, 2009 6:42 pm
Subject: Re: How to auto-click QTTabBar tab with mouse hover?
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, "ginnieg23" <ginnieg23@...> wrote:
>
> Hi, after alot of time reading the help file
> and trying the demos, I still can't figure out
> how to modify an already existing Windows program.
>
> I use QTTabBar 1.2.3 Beta5 on XP_Pro_sp3 to modify Windows Explorer, and would
eliminate alot of wrist/finger pain if I could configure PowerPro to auto Left
click the folder tabs when I hover over them with my Logitech mouse.
>
> Could anyone please help me understand how to configure this?
> Thank you very much ...
>

If there is something unique you can detect when the app's folder tabs is under
the mouse, you could have a script constantly testing every few seconds for that
condition. When conditions are right, the script could send a left click to the
mouse coordinates.

You could start by using *Exec WindowInfo and see what it says when the mouse is
over a folder tab.

Regards,
Sheri

#2222 From: "ginnieg23" <ginnieg23@...>
Date: Wed Nov 4, 2009 12:11 am
Subject: How to auto-click QTTabBar tab with mouse hover?
ginnieg23
Offline Offline
Send Email Send Email
 
Hi, after alot of time reading the help file
and trying the demos, I still can't figure out
how to modify an already existing Windows program.

I use QTTabBar 1.2.3 Beta5 on XP_Pro_sp3 to modify Windows Explorer, and would
eliminate alot of wrist/finger pain if I could configure PowerPro to auto Left
click the folder tabs when I hover over them with my Logitech mouse.

Could anyone please help me understand how to configure this?
Thank you very much ...

#2221 From: "Sheri" <silvermoonwoman@...>
Date: Mon Nov 2, 2009 2:15 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, Brother Gabriel-Marie <brgabriel@...>
wrote:
>
> That sounds like an idea. I will have to ponder that for awhile
> till I find the time to defeat the learning curve on both the
> adobe scripts and the powerpro coding... when I get there, I will
> sure see if you are willing to help me. First thing to do then,
> is to learn the Code Accelerator. I am also attempting to learn a
> little adobe scripting. So we'll see where to go from there!
> Thanks for all your help so far.

In case you are struggling, if you use the CA file format with one line per
item, e.g.

from=to
this=that
..etc...

fwiw, the following script would process them all. The last argument, btrialrun,
can be set to 1 for testing purposes. If InDesign is not open, brialrun is
automatically set to 1. Either way a log file is kept. If replacements are
processed, it will tell you how may replacements were made for each set of
from/to. The script puts all the from's and to's into a 2d vector by processing
the contents of the chgfile with a regular expression in regex.pcrematchall. It
then logs and processes (unless its a trial run) each set in a powerpro "for"
loop.

A sample call to it would be:

.nameofscript@IndesignReps(?"C:\path to chgfile\file.txt", 1, 1, 0)

Regards,
Sheri

Function IndesignReps(chgfile, wholeword, casesensitive, btrialrun)
local logfilename=pprofolder++?"IndesignReplacementScript.log"
if (not anywindow("=Indesign") or btrialrun==1) do
   messagebox("OK", "InDesign Replacements trial run.")
   btrialrun=1
elseif (not btrialrun)
   local a =messagebox("OKCancel", ;;+
     "InDesign Replacements to be processed:\n"++ ;;+
     "ChgFile: "++chgfile++"\n"++ ;;+
     "WholeWord: "++wholeword++"\n"++ ;;+
     "CaseSensitive: "++casesensitive++"\n")
   if (a == 0)
     quit
   local com_status, com_type
   local appRef = com.create_object("InDesign.Application")
endif
local chgread=file.readall(chgfile)
local chgpat=regex.pcrecompile(?"(?m)^([^;][^=\r\n]*)=(.+)$")
local chgcount=chgpat.pcrematchcount(chgread)
if (chgcount==0) do
   messagebox("no change records found, quitting")
   quit
else
   local logfile = File.Open(logfilename, "a")
   logfile.writeline("")
   if (btrialrun) do
     logfile.writeline("Trial Run "++formatdate("MM/dd/yyyy ", ;;+
       date.today)++formattime("hh:mm:ss", time) ++ ;;+
       " wholeword: "++ wholeword++ ;;+
       " casesensitive: "++casesensitive)
   else
     logfile.writeline("Live Run "++formatdate("MM/dd/yyyy ", ;;+
       date.today)++formattime("hh:mm:ss", time) ++ ;;+
       " wholeword: "++ wholeword++ ;;+
       " casesensitive: "++casesensitive)
   endif
   logfile.writeline(chgcount++" change spec(s) found in "++chgfile)
   if (btrialrun)
     logfile.writeline("Replacement commands created:")
endif
local chgVec=vec.create2D(chgcount, 3)
chgpat.pcrematchall(chgread,"",chgvec)
for (local i=0;i<chgcount;i++)
   logfile.writeline(?"  appRef.Search("++ ;;+
     "\x22"++chgVec[i,1]++"\x22"++ ;;+
     ?","++wholeword++?","++casesensitive++ ;;+
     ?","++"\x22"++chgVec[i,2]++"\x22)")
   if (not btrialrun) do
     local r=appRef.Search(chgVec[i,1],wholeword,casesensitive,chgVec[i,2])
     logfile.writeline("  "++r.count++" Replacements Processed "++ ;;+
       formattime("hh:mm:ss", time))
     r.Release
   endif
endfor
if (not btrialrun) do
   logfile.writeline("Processing completed at " ++ ;;+
     formattime("hh:mm:ss", time))
   appRef.Release
   com.unload
endif
logfile.close
do ("notepad.exe", logfilename)
quit

#2220 From: Brother Gabriel-Marie <brgabriel@...>
Date: Fri Oct 30, 2009 1:26 am
Subject: Re: Attn Sheri! How to create global autocomplete?
brother.gabriel
Offline Offline
Send Email Send Email
 
That sounds like an idea.  I will have to ponder that for awhile till I
find the time to defeat the learning curve on both the adobe scripts and
the powerpro coding...  when I get there, I will sure see if you are
willing to help me.  First thing to do then, is to learn the Code
Accelerator.  I am also attempting to learn a little adobe scripting.
So we'll see where to go from there!  Thanks for all your help so far.
- Brother Gabriel-Marie

#2219 From: "Sheri" <silvermoonwoman@...>
Date: Wed Oct 28, 2009 4:29 am
Subject: Re: Attn Sheri! How to create global autocomplete?
silvermoonwo...
Offline Offline
Send Email Send Email
 
--- In powerpro-beginners@yahoogroups.com, Brother Gabriel-Marie <brgabriel@...>
wrote:
>
> However, that is an interesting idea of interfacing the indeisng
> script with powerpro. This is new to me so it will take some
> investigation, but your sample will help alot. Thank you!

If the scriptlet works, you could do a series (powerpro loop, e.g., for each) of
indesign replacements based on one or more Code Accelerator source files. Would
probably be easiest if all the items in a file could use the same combination of
WholeWord and CaseSensitive options for replacements.

Regards,
Sheri

#2218 From: Brother Gabriel-Marie <brgabriel@...>
Date: Tue Oct 27, 2009 2:20 pm
Subject: Re: Attn Sheri! How to create global autocomplete?
brother.gabriel
Offline Offline
Send Email Send Email
 
The problem is the way InDesign uses dictionaries.  There is no Latin
dictionary (unless I purchase one from somewhere), and I would be forced
to add my Latin word list to an existing non-Latin dictionary.  If I
could only insert a blank dictionary into Ind, then I could use pure
Latin spelling on the user dictionary attached to it.  But alas, this
cannot be done.  Even if you managed a blank dictionary, you still would
have to change the code in the spell-checker plugin itself so that it
would recognize that dictionary.

However, that is an interesting idea of interfacing the indeisng script
with powerpro.  This is new to me so it will take some investigation,
but your sample will help alot.  Thank you!

- Brother Gabriel-Marie

Messages 2218 - 2247 of 2247   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help