• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

AppleScript Error -2741

New Here ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

I'm running a duplicate of the FindChangeByList.applescript using newly generated text query from the RecordFindChange_CS3-CS5 script. but I keep getting this error:

Error String: adobe indesign 2021 got an error: expected "'" or "}" but found "."

 

Here is my txt document:

--FindChangeList.txt --A support file for the InDesign AppleScript FindChangeDirectory.applescript -- --This data file is tab-delimited, with carriage returns separating records. -- --The format of each record in the file is: --findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description -- --Where: --<tab> is a tab character --findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use). --findProperties is a properties record (as text) of the find preferences. --changeProperties is a properties record (as text) of the change preferences. --findChangeOptions is a properties record (as text) of the find/change options. --description is a description of the find/change operation -- --Very simple example: --text {find what:"--"} {change to:"^_"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find all double dashes and replace with an em dash. -- --More complex example: --text {find what:"^9^9.^9^9"} {applied character style:"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". -- --All InDesign search metacharacters are allowed in the "find what" and "change to" properties. --
text {, findWhat:"Welldynerx, Llc"} {, changeTo:"Welldynerx, Llc -"} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true, wholeWord:false, caseSensitive:false, kanaSensitive:true, widthSensitive:true, ignoreKashidas:true, ignoreDiacritics:false, searchBackwards:false} //Comment text {, findWhat:"Welldynerx-Fl"} {, changeTo:"Welldynerx-Fl -"} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true, wholeWord:false, caseSensitive:false, kanaSensitive:true, widthSensitive:true, ignoreKashidas:true, ignoreDiacritics:false, searchBackwards:false} //Comment

TOPICS
Scripting

Views

360

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

I updated my custom querries but the second one isn't working ("Welldynerx, Llc"):

text {find what:"Welldynerx-Fl"} {change to:"Welldynerx-Fl -"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find all space-dash-space and replace with an en dash.
text {find what:"Welldynerx, Llc"} {change to:"Welldynerx, Llc -"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find all space-dash-space and replace with an en dash.

 

Does this have to do with the comma?

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2021 Feb 24, 2021

Copy link to clipboard

Copied

Try the following

text	{findWhat:"Welldynerx, Llc"}	{changeTo:"Welldynerx, Llc -"}	{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

Notice that I changed the keys like find what to findWhat etc, they have to be written in the same format as I have and also shown in the sample entries in the findChangeList.txt file. Another thing to note is that the space in the string before { and after } has to be a tab character

-Manan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 24, 2021 Feb 24, 2021

Copy link to clipboard

Copied

Thank you for your help but I don't think there was anything wrong with my formatting.

Here is the updated code I have (LLC works but FL does not now):

text	{find what:"Welldynerx, Llc"}	{change to:"Welldynerx, Llc -"}	{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}	Add mailbox after Welldynerx, Llc.	
text	{find what:"Welldynerx-Fl"}	{change to:"Welldynerx-Fl -"}	{include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}	Add mailbox after Welldynerx-Fl.

If I flip the two strings of code, FL works but LLC does not:

text	{find what:"Welldynerx-Fl"}	{change to:"Welldynerx-Fl -"}	{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}	Add mailbox after Welldynerx, Llc.	
text	{find what:"Welldynerx, Llc"}	{change to:"Welldynerx, Llc -"}	{include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}	Add mailbox after Welldynerx-Fl.

 There must be something missing between the two to tell InDesign there is a second search command?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2021 Feb 24, 2021

Copy link to clipboard

Copied

LATEST

Apologies my comment was meant for Javascript but now I see that you are talking about Applescript. I tried your strings and it seems to be working for me, see the screengrab at the following link

https://www.dropbox.com/s/htav2iidmhg2c51/screen%20recording%202021-02-24%20at%207.48.38%20pm.mov?dl...

-Manan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines