Copy link to clipboard
Copied
Hi,
Below are the code i can able to load the user dictionary in PC(windows). For mac its not working.
with(app.dictionaryPreferences){
//PC//// var fo ="C:/lib/GHM_07_July2016.udc"
var fo="/Applications/GHM-Dictionary/GHM_07_July2016.udc"
alert(fo)
app.languagesWithVendors.itemByName('English: USA').addDictionaryPath(File(fo));
}
please guide me.
Thanks in advance...
Regards
AshokInDesign Scripting
Hi together,
I can add an udc file to languagesWithVendors on my German InDesign.
( The used string "Deutsch: Rechtschreibreform 1996" is "German: Reformed" with an English version of InDesign )
Since the following is not working—I assume it's a bug with my German versions of InDesign:
try{
app.languagesWithVendors.itemByName("Deutsch: Rechtschreibreform 1996").name;
}catch(e){$.writeln("ERROR:"+"\t"+e.message)};
//Result:
// ERROR: Objekt ist ungültig
// ERROR: Object is not valid
I have to loop th
...Copy link to clipboard
Copied
Uwe,
Is there any method to get path in that Mac format: Macintosh HD:path:to:my:file.udc ?
Can't find correct API method for that... Or do we need to manually build it with adding disk name and replace / with :
PS: I think we need to make special model (from MVC) for adding / removing dictionaries based on the system OS and collect such models somewhere in open source GitHub page
Copy link to clipboard
Copied
oleh.melnyk wrote:
Uwe,
Is there any method to get path in that Mac format: Macintosh HD:path:to:my:file.udc ?
Can't find correct API method for that... Or do we need to manually build it with adding disk name and replace / with :
Hi Oleh,
getting the name of a disk is discussed in the thread I linked to below.
There may be other discussions in this forum as well.
ExtendScript Oddity with File/Folder on Mac OS X
RorohikoKris Feb 6, 2012
https://forums.adobe.com/message/4187884#4187884
Let's see, if we can bring the two tasks together.
Regards,
Uwe
Copy link to clipboard
Copied
oleh.melnyk wrote:
…5. In order to make new dictionary work you need to select text and reapply language, which is a bit weird - and by reapplying I mean apply another language, then apply original lang
Yes, Oleh, item 5 is working, if I switch to "No Language" of a text selected and back to the language where I added the dictionary. However, hyphenation is still a problem. That means: Not to hyphenate a word that is listed in the user dictionary is a problem. Spell checking is working as expected…
Regards,
Uwe
Copy link to clipboard
Copied
Uwe,
Have you added hyphenation rules to your custom dictionary?
PS: I think it would be great if we could make those user dictionaries synchronize with the server to build a better, up-to-date dictionaries for hyphenation, spell check, title/sentence case etc.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi Ashok,
Don't forget to pick the correct answer.
Thanks
Copy link to clipboard
Copied
Yay! I made it! Now everything works!
It might look a bit over complicated, but it consists of small reusable building blocks, which is way better than spaghetti code with the all-in-one file... Reusable code is the key for better scripts, which is easier to understand, extend and support.
Copy link to clipboard
Copied
Hi Oleh,
I still had no time looking much into your scripts ( thank you very much for providing them! ), but be careful with "getDriveName.jsx". Mac OSX allows path and file names using "/" in the names (and I've seen them in projects provided by customers) like that:
"Macintosh HD:test/InDesign:myFileToTest/CS6.indd"
I did not test your script with folder/file names like this.
Just a warning…
Best,
Uwe
Copy link to clipboard
Copied
Hi Uwe,
"getDriveName.jsx" should be fine, as it returns just drive name, such as "Macintosh HD".
The problem might be in "pathToMacOS9Style.jsx", which probably should be renamed to "oldMacPath" - this module is for trying to convert the path to old style with colon separator, which was used in Mac OS 9 and below, but Mac OS 9 is not supported since 2002, so this OS's and file path style should be deprecated for at least 14 years! I don't understand why people and software developers, such as Adobe still using it...
For now, I can't find specifications for that format, but if "/" is the only case - I think I can do something with that - right now need more info.
PS: I have found that there's "macpath.py" module, built in Python 2.7 that were made to support that path conversion, but I don't know Python that well to port it to JS, not sure if it helps
Copy link to clipboard
Copied
Ok, I have renamed old "pathToMacOS9Style.jsx" file to "oldMacPath.jsx" and modified it to handle "/" in file/folder name - now everything should work just fine!