Copy link to clipboard
Copied
I'm trying to use this pre-made script in CS4, and I customized the accompanying .txt file with all our Find-and Replace needs, but when I actually try to the run the script on a document, the following error message comes up:
Error Number: 23
Error String: does not have a value
File: [name and location of jsx file follows]
Line: 159
Source: app.doScript(myString, ScriptLanguage.javascript);
Anyone know how to get past this? It's very hard to see what Line 159 in the script file has to do with anything.
Thanks.
Copy link to clipboard
Copied
Bloody hell fella, it's a free and gratis script, by all means fix that problem if you want to ...
I'd be inclined to use it verbatim, it's capturing stuff from that search that ID is using but you don't see
Take it out if you want to, it's very transparent
Copy link to clipboard
Copied
Sorry, didn't mean to upset you. But er (hope this won't upset you even more)... I am back to the FindChangeByQueries script I was so happy about, because using the create-script and the list brings back the main problem I had with the list (which I posted about in that other topic): whenever I use the list script and replaced \n with \r, I can't replace multiple \r anymore... Apparently it's a list-script limitation. Luckily the FindChangeByQueries script works perfectly well.
Thanks for all the (very quick) help anyway, it's really much appreciated.
Copy link to clipboard
Copied
s'alright, not my scripts
hey, whatever works best for you, Kasyan really has overdelivered on this topic, there's at least two very workeable ways to tackle the problem(s)
I'm suprised the FindChamgebyList doesn't work, it can be delicate but it seems to work in the end when you present the code ust right, have you tried using the CS4 version? That's what fixed it for me with a GREP search that didn't run under the CS3 version, if you read up the thread a bit I think Kasyan posts the CS4 version
Laters
Copy link to clipboard
Copied
Hello all
Back to Kasyan's script to relink pictures ...
I've been using it alot and brill
I'm now trying to use it to relink pictures where only the core name is the same
So I have a link referring to sample.jpg and I need to link to sample_C.jpg
And also sample2_.jpg to sample2_C.jpg
And also sample2.jpg to sample2_USA_C.jpg
and so on
I changed the array of extentions to the following
var myExtentions = ["_C.jpg", "C.jpg", "LaosCam_C.jpg", "_LaosCam_C.jpg", "_LaosCam_C.JPG", "_LaosCam_C.tif", "_LaosCam_C.eps", "eps", "tif", "jpg", "eps", "tif", "psd", "epsf", "pdf", ""];
Now the annoying thing is that it works perfectly but only for the first member of the array. If I shuffle the necessary members in turn to the front of the array and run the script again it gets there but I can;t see why it won't run through all the members as it should/
I redownlaod the script again and changed only that one line but no dice
So close and so far, I'd be ever so grateful if someone can give a clue as why that doesn't work
Thanks
Tynan
Copy link to clipboard
Copied
Hi davebillet,
At a glance, your FindChangeList.txt file looks fine, so I'd suspect either line end characters or missing/extra tab characters. Kasyan, was that the problem? (And thanks for helping, Kasyan and Dave!)
Thanks,
Ole
Copy link to clipboard
Copied
Hi Ole,
Two lines contained superfluous tabs after find what: Find all dash-dash and replace with an em dash and Find all ellipses and replace with consecutive period thin space thin spaces.
The "Find all returns followed by a space And replace with single returns" line was repeated twice.
But I’ve found another problem with this script: the following line in the comments shows incorrect example of how to find a text and apply character style "price" to it.
//text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price".
A correct reference to the character style should be app.activeDocument.characterStyles.itemByName("price") or app.activeDocument.characterStyles.item("price").
I was asked about applying character style by this script twice for last three weeks. When I was asked it for the first time I tried to apply the syntax suggested in the comments, but the script threw an error and stopped. So I reported that it’s impossible to do and wrote my own script. But when I told David about that, he pointed me out to an article in InDesign Magazine: downloads.indesignmag.com/supportfiles/InDesign_Magazine_Issue8_Excerpt.pdf (See page 48). So I decided to sort it out. The article is about the TextCleanup.jsx script for CS2, which is a previous version of FindChangeByList.jsx. But the example given in it is incorrect as well. I think there is the same problem with the version for CS4 too.
For the script to work we should use the syntax from OMV, this is obvious for us scripters. But how ordinary people should know this? May be I should create a web-page on my site explaining this?
I am thinking on creating a new, more complex search-replace script. Actually I've already started to write it. The idea is as follows:
When a user runs the script a floating panel with 3 buttons appears.
Instead of writing tab delimited mumbo jumbo strings, user runs a sample query which is undone automatically by the script (button 1).
Then he adds description and saves the chosen settings to a text file (button 2).
Finally he runs a series search-replace operations. The script reads all saved files and loops thru each saved settings (button 3).
But I am not sure if anybody is interested in it.
Kasyan
Copy link to clipboard
Copied
Hi Kasyan,
You're right--the example shown in the comments is wrong. I've been meaning to fix it for some time now.
I think that the next version of the script will use the user's own saved Find/Change operations, rather than the text file. It's a very popular script, but it can certainly be made better.
Thanks,
Ole
Copy link to clipboard
Copied
Ole,
Recently I watched your videocast on AdobeTV — I am a graphic designer and illustrator by education too.
Copy link to clipboard
Copied
Hi Kasyan,
I had no idea that was there....:-)
I think that was one of my worst presentations, ever. But a few people seemed to get it, anyway.
Thanks,
Ole
Copy link to clipboard
Copied
Ole,
did you get around to doing that? I'm trying to find placeholder text in the left footers for a document and replace the first instance with this issue's footer for that page; then find the next instance of the same placeholder text and replace it with that page's specific footer text etc. line by line through the file until the placeholder text is no longer found. But I can't seem to find the correct syntax for the findreplaceoptions to run the find and change only once before moving on to the next line of the file.
Copy link to clipboard
Copied
Hey Kaysan, I'm new to all this but know your name already, you're doing fanatstic stuff
I've just found your link script on your home page and if it works it's going to be a lifesaver for me
This new one looks excellent too, If it runs GREP searches as well that's be amazing, I've got a javascript that runs a load of stuff but it doesn;t like the more complex GREP searches even though they run pefectly within Indesign's Find/Change queries
Thanks
Copy link to clipboard
Copied
+1 to Kasyan doing fantstic work, I've used a few of his scripts in the project to fully format a text file in a single pass, I'm now using the script from his site that captures an ID Find.Change search for the FindChangeByList.txt
brilliant
The only thing left that I can;t get to run in the javascript FindChangeByList is the URL search, it runs fine in ID but won't as partof the script, I've read sundry comments saying more complex grep searched won't run as part of the FindChangeByList script
It really is the last thing I need to get running before it's a shining masterpiece
This is what I have, any ideas from the gurus? Many thanks to Kasyan, again
grep {findWhat:"(?i)(http|ftp|www)(\\S+)|(\\S+) (\\.gov|\\.us|\\.co\\.uk|\\.net|\\.com|\\.edu|\\.org|\\.org/|\\.biz)"} {appliedCharacterStyle:"www."}
Copy link to clipboard
Copied
Can you paste the GREP search expression that works in InDesign?
It seems to me there should be even more backslashes in the script version (every singe backslash needs doubling), but it's kinda hard to see which one(s).
Copy link to clipboard
Copied
Hi fella and thanks for the quick response
(?i)(http|ftp|www)(\S+)|(\S+) (\.gov|\.us|\.net|\.com|\.edu|\.org|\.org/\.biz)
that works, at least for the things we need to find
Thanks
Tynan
Copy link to clipboard
Copied
Okay, I think I see it. You did a good job on doubling the backslashes, except for this one:
.org/|\\.biz
The pipe should not be there.
(at least, I hope it's this simple -- not being at the right computer, can't check)
Copy link to clipboard
Copied
I think that's correct though, I added that bit to capture instances where the search was missing the trailing '/' of a URL
The pipe seperates it from the next match, '.biz'
I've tried an awful lot of combinations and massive simplifications to try and make it work, it simply doesn't seem to want to work
Granted my scripting is rank beginner level at best so I could be making any mistake
I captures the search using the script from Kasyan's site so that should be the FindChangeByList equivalent of the working script in ID
If you're keen and feeling helpful I'd be very grateful indeed if you could try the ID Find/Cange grep search in ID3, see that it works and then replicate it in FindChangeByList
I strongly suspect that the script plain won;t run that much grep in one line which is an awful shame if true
I will try the pipe change though, just in case and seeing as you know 10000 times more about this than me
Thanks
Tynan
Copy link to clipboard
Copied
It sounds you are trying the right things. Unfortunately, my home CS doesn't come with GREP ...
FindChangeByList has some problems with correct formatting of the lines (I think that's discussed in this same thread). Perhaps that's why it fails.
I hope someone else comes up with more ideas.
Copy link to clipboard
Copied
Hi Tynan,
The following line works for me:
grep {findWhat:"(?i)(http|ftp|www)(\\S+)|(\\S+) (\\.gov|\\.us|\\.net|\\.com|\\.edu|\\.org/\\.biz)"} {appliedCharacterStyle:"www."} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true} //Comment
I tested it on CS3 for Mac. I used the version of the script for CS4 – It seems to be more reliable. I've attached both files: jsx and txt.
You typed \.org| twice, so I removed one of them.
Kasyan
Copy link to clipboard
Copied
I'll test that sharpish, thanks in advance, I'm going to get a plaque put in our office to you!
CS4 script will run in CS3? The galling thing is we have CS4 installed but are banned from using it to keep us in line with co-publishers, most of whom reset our books into bloody Quark v6 anyway
Not important but that extra org was in there to catch the ones with a trailing backslash/forwardslash
Thanks again gents, javascript is wonderful stuff and the scripts shared out have ben excellent, the scripts from the Kasyan site are putting in hours and hours of work every single day here
bless you
Tynan
Copy link to clipboard
Copied
CS4 script will run in CS3?
Yes, it works.
Copy link to clipboard
Copied
Hi,
I must insert a new query in this example.
If I save the query by indesign interface obtain the file .xml with the preference like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Query>
<Header>
<Version major="5" minor="1">
</Version>
<Application value="Adobe InDesign">
</Application>
<QueryType value="Grep" qid="1">
</QueryType>
</Header>
<Description>
<FindExpression value=".{20,}">
</FindExpression>
<ReplaceExpression value="">
</ReplaceExpression>
<FindChangeOptions>
<IncludeLockedLayers value="0">
</IncludeLockedLayers>
<IncludeLockedStories value="0">
</IncludeLockedStories>
<IncludeMasterPages value="0">
</IncludeMasterPages>
<IncludeHiddenLayers value="0">
</IncludeHiddenLayers>
<IncludeFootnotes value="1">
</IncludeFootnotes>
<KanaSensitive value="1">
</KanaSensitive>
<WidthSensitive value="1">
</WidthSensitive>
</FindChangeOptions>
<FindFormatSettings>
<TextAttribute type="cstyle" value="_M">
</TextAttribute>
</FindFormatSettings>
<ReplaceFormatSettings>
<TextAttribute cls_id="6948" value="0">
</TextAttribute>
<TextAttribute type="changecondmode" value="0">
</TextAttribute>
</ReplaceFormatSettings>
</Description>
</Query>
How can insert this in the file FindChandgeList.txt for execute by script?
Thanks
Sara
Copy link to clipboard
Copied
You can't do this. Use this script to record settings from Text and GREP tabs, then copy and paste them to FindChandgeList.txt file.
http://www.kasyan.ho.com.ua/downloads/RecordFindChange_CS3_Kas.zip
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I was so excited to read this thread and try out these wonderful scripts, but I cannot get the RecordFindChange script to do anything other than say "done." I've read the posts that it creates a popup under other windows but I've hidden or moved everything out of the way and there is nothing there. I would try the other script but I really need to use GREP.
Here's what I've done:
Using CS3 on a Mac
installed the script RecordFindChange_CS3_Kas.jsx
restarted InDesign
open document
open Find/Change
go to GREP tab
enter what I want in Find what and Change to fields
run the script
receive Done message one nanosecond after double clicking on the script
no popup
Can anyone tell me what I'm doing wrong? Thanks.
Copy link to clipboard
Copied
Hi
I can’t remember now I'm afraid other than it drives you mad until you work out what happens, follow the instructions to the letter, the order you do things is important I think
It is a cracking script once you get it working, I have an enormous list of things working now in the findchangebylist, if you’re still stuck by Monday, wen I return to work I'll fire it up and have another go
Hang on, it doesn’t capture grep does it?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now