Search found 328 matches
- 01 Mar 2021 10:33
- Forum: Plugin Technical Support & Development
- Topic: Error when renaming file with accented characters
- Replies: 29
- Views: 7305
Re: Error when renaming file with accented characters
@Mike When using fhConvertUTF8toANSI it converts the characters in the range (0-255) as expected and the plugin reports the conversion. For characters outside this range fhConvertUTF8toANSI will convert to something as close as possible (according to the help; I tested it and it's doing a nice job)....
- 28 Feb 2021 17:06
- Forum: Plugin Technical Support & Development
- Topic: Error when renaming file with accented characters
- Replies: 29
- Views: 7305
Re: Error when renaming file with accented characters
Helen, thanks for looking into it. Would have been nice, but fhConvertUTF8toANSI will do for most accented characters.
I think I'll change the plugin to replace "invalid" characters with '~' and report it in the result set.
I think I'll change the plugin to replace "invalid" characters with '~' and report it in the result set.
- 27 Feb 2021 17:58
- Forum: Plugin Technical Support & Development
- Topic: Error when renaming file with accented characters
- Replies: 29
- Views: 7305
Re: Error when renaming file with accented characters
Can't get it from Dropbox either; zip will do.
- 27 Feb 2021 17:21
- Forum: Plugin Technical Support & Development
- Topic: Error when renaming file with accented characters
- Replies: 29
- Views: 7305
Re: Error when renaming file with accented characters
@Mike I'll put the warning in the plugin and also check for when it happens.
@Helen/@Mike Can I help to get winapi supported by CP and if so how?
@Helen/@Mike Can I help to get winapi supported by CP and if so how?
- 27 Feb 2021 11:19
- Forum: Plugin Technical Support & Development
- Topic: Howto save and use setting from within a plugin?
- Replies: 1
- Views: 1097
Howto save and use setting from within a plugin?
I have a few plugins that may be of interest for Dutch users. One of them parses data from often used websites and uses the result to fill the (meta) fields of a source. To make the plugin usable for others I need to provide a mapping from the parsed data to 'their' (meta) fields. Hence my question:...
- 27 Feb 2021 11:05
- Forum: Plugin Technical Support & Development
- Topic: Error when renaming file with accented characters
- Replies: 29
- Views: 7305
Re: Error when renaming file with accented characters
Mike, I didn't use the api, but used the conversion table in the stackoverflow example starting with: utf8_to_cp1252 = ( function(cp1252_description) .... That gives me the same results as using fhConvertUTF8toANSI . Yesterday I've published the updated version (1.2) of Rename Selected Source Media ...
- 26 Feb 2021 18:35
- Forum: Plugin Technical Support & Development
- Topic: Error when renaming file with accented characters
- Replies: 29
- Views: 7305
Re: Error when renaming file with accented characters
Clear explanation.
Thanks Mike!
Thanks Mike!
- 26 Feb 2021 17:22
- Forum: Plugin Technical Support & Development
- Topic: Error when renaming file with accented characters
- Replies: 29
- Views: 7305
Re: Error when renaming file with accented characters
Indeed tricky. I now have os.rename working with Helen's solution ( https://stackoverflow.com/a/36719757/1943174 ) as well as Mike's ( fhConvertUTF8toANSI ). As far as I can see both conversion results are the same. The tricky thing is that I need to store the filename in the media record without th...
- 25 Feb 2021 16:21
- Forum: Plugin Technical Support & Development
- Topic: Error when renaming file with accented characters
- Replies: 29
- Views: 7305
Error when renaming file with accented characters
I have a plugin that changes the names of the media linked to a selection of sources to the auto title of the source. Works very well but not with accented characters. As soon as ë or é etc. are in the title os.rename throws an error. Correcting it manually is no problem (the filename, media name an...
- 16 Feb 2021 11:25
- Forum: Plugin Technical Support & Development
- Topic: Check if source is new or existing
- Replies: 7
- Views: 2506
Re: Check if source is new or existing
Agreed Helen, 'not all', but (as a retired mathematician :)) that means that at least one remains. And if I'm guessing right, you as a experienced DEA developer know which one (maybe one of your own). Which brings me back to my original question... how have you (or anyone that did DEA's that needed ...
- 15 Feb 2021 10:06
- Forum: Plugin Technical Support & Development
- Topic: Check if source is new or existing
- Replies: 7
- Views: 2506
Re: Check if source is new or existing
Thanks Helen, unfortunately indeed.
Makes me wonder how all the DEA plugins verify that the the source/citation is a new and empty one. I would expect this to be an important check.
Makes me wonder how all the DEA plugins verify that the the source/citation is a new and empty one. I would expect this to be an important check.
- 14 Feb 2021 18:13
- Forum: Plugin Technical Support & Development
- Topic: Check if source is new or existing
- Replies: 7
- Views: 2506
Re: Check if source is new or existing
What I mean is that in object oriented programming it is good practice to use methods to access data in an object. Thereby allowing the owner (CP in this case) of the object to change/extend the internals of the object without any consequence for the users. As it is, I am now using data inside the p...
- 04 Feb 2021 13:49
- Forum: Plugin Technical Support & Development
- Topic: Check if source is new or existing
- Replies: 7
- Views: 2506
Check if source is new or existing
In a DEA plugin I test if a Prepared Citation exists to make sure it's run as a DEA. In addition I test the length of the fields table in the pCite Object to determine if the Source is newly created (empty source) or an existing one (if > 3). If however CP changes the pCite Object the test may be in...
- 02 Feb 2021 00:19
- Forum: General Usage
- Topic: Replacing missing surname in source title
- Replies: 4
- Views: 1328
Re: Replacing missing surname in source title
Yes, that's it.
Thanks Mike!
Thanks Mike!
- 31 Jan 2021 16:18
- Forum: General Usage
- Topic: Replacing missing surname in source title
- Replies: 4
- Views: 1328
Re: Replacing missing surname in source title
@Mike
I replaced the Not Exist with TextIf but still get the error. Any ideas?
I replaced the Not Exist with TextIf but still get the error. Any ideas?
- 31 Jan 2021 15:23
- Forum: General Usage
- Topic: Replacing missing surname in source title
- Replies: 4
- Views: 1328
Replacing missing surname in source title
Some persons in my database have no surname. When using {Persoon:REVERSE} in my template title field, I end up with a starting comma. I Thought to fix that by prefixing it with: {=NotExistsText(%SOUR.~NM-PERSOON>NAME:SURNAME%, "NN")} . But something must be wrong since it's not accepted. Help is ver...
- 31 Jan 2021 15:17
- Forum: Plugin Technical Support & Development
- Topic: Can 'automatic enabled' be disabled in a plugin?
- Replies: 4
- Views: 1753
Re: Can 'automatic enabled' be disabled in a plugin?
It is as it is. 
Thanks.
Thanks.
- 31 Jan 2021 11:43
- Forum: Plugin Technical Support & Development
- Topic: Can 'automatic enabled' be disabled in a plugin?
- Replies: 4
- Views: 1753
Re: Can 'automatic enabled' be disabled in a plugin?
I completely agree; that's why I'd like to be able to disable it from within my DEA plugin instead of by hand every time.
I see no difference between doing it by hand or as a step in the DEA plugin (if necessary the plugin might present a warning and ask for an OK).
I see no difference between doing it by hand or as a step in the DEA plugin (if necessary the plugin might present a warning and ask for an OK).
- 28 Jan 2021 21:03
- Forum: Plugin Technical Support & Development
- Topic: Can 'automatic enabled' be disabled in a plugin?
- Replies: 4
- Views: 1753
Can 'automatic enabled' be disabled in a plugin?
I use automatic enabled sources a lot (great feature). But when I run my DEA in a new (empty) source it's complaining that enable should be disabled. No idea why; it's pretty clear where I am and what I try to do. It would be great if I could somehow switch this behavior off when starting the DEA. C...
- 28 Jan 2021 15:43
- Forum: Plugin Technical Support & Development
- Topic: Show a plugin prepared citation
- Replies: 28
- Views: 5737
Re: Show a plugin prepared citation
I'll give it a try. Thanks for the suggestion Helen.
- 27 Jan 2021 17:37
- Forum: Plugin Technical Support & Development
- Topic: Show a plugin prepared citation
- Replies: 28
- Views: 5737
Re: Show a plugin prepared citation
It's now working fine. Thanks again. I've attached the plugin because I was wondering if it might be of interest to others. Of course it depends a bit on the user's names/definitions of the meta-fields, but I've put them as variables in the plugin. Actually I would like to combine this plugin with m...
- 26 Jan 2021 23:00
- Forum: Plugin Technical Support & Development
- Topic: Show a plugin prepared citation
- Replies: 28
- Views: 5737
Re: Show a plugin prepared citation
Thanks Mike, for all the help.
Stupid mistake... it's either tired or old age...
I'll give it a fresh start tomorrow morning.
Stupid mistake... it's either tired or old age...
I'll give it a fresh start tomorrow morning.
- 26 Jan 2021 21:50
- Forum: Plugin Technical Support & Development
- Topic: Show a plugin prepared citation
- Replies: 28
- Views: 5737
Re: Show a plugin prepared citation
I did as you wrote (at least I think I did :)), but I can't get it working The code now looks like: pMedia = fhGetItemPtr(pSource,'~.OBJE>') pFile:MoveTo(pMedia,'~.FILE') -- Set Media Title to Source Title (= filename) pTitle = makeTag(pFile,'TITL') fhSetValueAsText(pTitle,sTitle) -- Set Source Date...
- 26 Jan 2021 20:02
- Forum: Plugin Technical Support & Development
- Topic: Show a plugin prepared citation
- Replies: 28
- Views: 5737
Re: Show a plugin prepared citation
The results of the debug: pMedia: Link to Media record (Boelhouwer, Margrieta - 1917-08-15 Nieuw Helvoet - SAVP O-21; 133) dDate: 15 August 1917 pDate: (null) - also after MoveTo(pMedia,'~._DATE') - also after pDate = fhCreateItem('_DATE', pMedia) isOK: false - after local isOK = fhSetValueAsDate(pD...
- 26 Jan 2021 17:11
- Forum: Plugin Technical Support & Development
- Topic: Show a plugin prepared citation
- Replies: 28
- Views: 5737
Re: Show a plugin prepared citation
It should work, but it doesn't and I don't know why. The code is: -- Set Source Date to Media Date local dDate = fhGetValueAsDate(fhGetItemPtr(pSource,'~.~DT-DATUM')) local pDate = fhNewItemPtr() pDate:MoveTo(pMedia,'~._DATE') if pDate:IsNull() then pDate = fhCreateItem( "_DATE", pMedia, true ) end ...