Page 1 of 2
Quick Link Creator
Posted: 10 Aug 2017 11:01
by Jane
I have written a small plugin which creates a "link" file on your desktop for a selected person.
Please see later post for the most recent version.
Re: Quick Link Creator
Posted: 10 Aug 2017 12:45
by tatewise
That is neat Jane.
But I think it needs to inform the user the batch file has been saved to Desktop and needs to be run to start FH next time.
Otherwise, not only does it appear that nothing has happened, but also the user does not know what to do.
I am fascinated how you discovered that FH has an INI file to perform that trick.
What else can that INI file do?
Why doesn't FH use it to let users choose which Individual has Focus on restart?
I've added this Plugin to how_to:remember_current_records_being_updated|> Remember Current Records being Updated.
However, I think the Plugin name could be better as it does not really convey what it is for ~ creates quick link to what?
Maybe something like Open Individual in Next Session would be better?
Re: Quick Link Creator
Posted: 10 Aug 2017 14:45
by davidm_uk
Yes, very neat
Is there an alternative for "Window=FocusWin" to open just the individual properties window (floating)? I never use the focus window. I'm quite happy to copy and modify the desktop cmd file rather than start complicating the plugin.
I'm sure that others will ask for all sorts of variations. As Mike says, knowing "What else can that INI file do?" would be very interesting.
Re: Quick Link Creator
Posted: 10 Aug 2017 14:53
by Jane
Funnily enough I am not using it as a remember for next time, which is why it names the files with the persons details. I use it to drop the file into Evernote, so I can jump to the right person from my research notes.
The INI only does the couple of things at the moment so start on a person and select Focus (FocusWin) or Record Window (RecordWin).
I knew about it as is was done as a "paid for" change for a Project I did for My History creating automated charts using Family Historian which is driven by a web site.
I have added a message once the file is created. Do you think it's worth offering to save with the Name as now, as well as a "fixed" file name so if you did just want to always save to the same filename you could. I have not changed the name yet, I might wait until the functionality has settled.
Re: Quick Link Creator
Posted: 10 Aug 2017 15:24
by davidm_uk
The INI only does the couple of things at the moment so start on a person and select Focus (FocusWin) or Record Window (RecordWin).
That was quick, works a treat.
Thanks Jane
Re: Quick Link Creator
Posted: 10 Aug 2017 15:44
by tatewise
Sounds like it needs a simple
GUI to offer user some options :-
- Choose Individual if currently selected record is wrong one
- Use a Fixed Filename or Person & Project Filename
- Startup in Focus Window or in Records Window
The
GUI could hold the explanatory message about the
Desktop command file.
A button would create the
Desktop command file.
Re: Quick Link Creator
Posted: 10 Aug 2017 15:49
by BillH
Jane wrote:Do you think it's worth offering to save with the Name as now, as well as a "fixed" file name so if you did just want to always save to the same filename you could.
Jane, yes that would be a nice addition. I would use it to start where I left off each time and wouldn't really need the persons name in the file name.
Thanks
Re: Quick Link Creator
Posted: 10 Aug 2017 17:53
by tatewise
Assuming the desire to open FH in the Focus Window or the Records Window is reflected in the Tools > Preferences > Startup > Display the Records Window option, then the Registry Key HKEY_CURRENT_USER\Software\Calico Pie\Family Historian\2.0\Preferences\Rec Win Startup value of True or False could automatically choose the INI file Window mode.
Re: Quick Link Creator
Posted: 10 Aug 2017 18:12
by Jane
Actually if you don't specify the window, I think it uses the default anyway.
I will have a play, but probably won't be tonight.
Re: Quick Link Creator
Posted: 10 Aug 2017 18:20
by tatewise
You are correct Jane, but then it IGNORES the Record= option!
Re: Quick Link Creator
Posted: 11 Aug 2017 13:49
by Valkrider
I just thought that I would give this plugin a try in PlayOnMac.
It creates a Mac desktop shortcut but as it is a .cmd file the Mac doesn't know what to do with it.
Just FYI not criticising.
Re: Quick Link Creator
Posted: 11 Aug 2017 15:07
by tatewise
Colin, is there an equivalent batch command file language for Mac that could be used instead?
All it is actually doing is copying some text to a plain text fhini.ini file and then running FH with some command line options.
Re: Quick Link Creator
Posted: 11 Aug 2017 15:15
by Valkrider
Mike
It will be a bit more complicated than that as the Mac has no concept of drive letters which are included in the paths in the cmd file.
What it may be possible to do is to create a startup application in PlayOnMac, I will have a look into that.
Re: Quick Link Creator
Posted: 11 Aug 2017 15:27
by tatewise
Colin, is there somewhere in the PlayOnMac PC environment that the batch CMD file can be saved instead of the Mac Desktop, because within that PC environment drive letters are understood otherwise the Plugins and Batch scripts employed with Ancestral Sources Data Entry and Backup and Restore FH Settings would never run at all.
Re: Quick Link Creator
Posted: 11 Aug 2017 15:59
by Jane
@Valkrider - I suspect it might be possible to create a mac template file fairly easily if you can tell me what needs to be in there.
I have added a popup selection screen which shows the currently selected record with a button to change it.
It defaults to the "Launch Family Historian" option, but you can change it to named files, it also defaults to the current start up workspace using Mikes read of the registry.
It puts the focus on the Create button so running and pressing enter twice will update the Launch script on the desktop.
I have not changed the name yet. So now it's mostly function complete, what should it be called?
Re: Quick Link Creator
Posted: 11 Aug 2017 16:26
by tatewise
To differentiate between running in genuine Windows or in PlayOnMac or Crossover use the following Plugin script:
Is_Windows = true -- Windows v PlayOnMac/Crossover/Wine
if fhGetPluginDataFileName("LOCAL_MACHINE"):lower():match(":\\users\\public\\") then Is_Windows = false end
Then test if Is_Windows then <use CMD template> else <use Mac template> end
That is the technique I use in my Plugins to determine the Windows versus Mac environment.
It relies on Mac using the C:\Users\Public\Application Data\... path instead of C:\ProgramData\... path.
See glossary:family_historian_program_data_folder|> Family Historian Program Data Folder.
Re: Quick Link Creator
Posted: 11 Aug 2017 17:29
by Jane
Just noticed a bug as the screen does not refresh correctly when you select a different record, new version below
Re: Quick Link Creator
Posted: 11 Aug 2017 17:53
by Valkrider
Jane
Looking at PlayOnMac it is possible to create another shortcut on the POM desktop to another programme.
As a result if for the Mac version the ini file and cmd file can be written to the FH or Calico Pie folder instead then it looks like it might be possible to create the shortcut to an individual.
Re: Quick Link Creator
Posted: 12 Aug 2017 09:54
by Jane
Colin, do you think you would have use for the plugin, if so where would you like the file put.
Re: Quick Link Creator
Posted: 12 Aug 2017 10:41
by Valkrider
Jane
Yes I would use it as I have about 20 different projects in FH. As a result what about storing them in the Export folder of the project.
What it would mean for me is getting back to an individual who is not necessarily the root person, this is particularly relevant for me where I have a Surname study with one project per country and the root person is not really relevant.
Re: Quick Link Creator
Posted: 12 Aug 2017 23:09
by zoomdoggies
Thanks for sharing, Jane. This will be a handy way to pick up where I left off.
The plug-in, as written, whined about not being able to find my Family Historian executable – don't know why not, since it was installed in the default place – but I hardcoded the path and it works like a champ.
– Teri
Re: Quick Link Creator
Posted: 13 Aug 2017 09:18
by Jane
I have added some code to try and support putting the file in the Project Public folder for Mac and also added a fall back check for Family Historian if the registry key read fails.
Re: Quick Link Creator
Posted: 13 Aug 2017 09:39
by Valkrider
Jane
Thanks for this but still not working for the PlayOnMac version I am afraid.
Could the ini file also be written to the same folder as the cmd folder rather than the temp folder? I don't think that the ini file is being created as I can find no trace of it on my HDD.
Re: Quick Link Creator
Posted: 13 Aug 2017 09:42
by tatewise
Teri, can you give more details about how the Plugin 'whined' and what path details are involved.
I wonder if FH needs to be reinstalled to correct the Windows Registry entry?
What version of Windows are you running? (Vista, 7, 8.1, 10, and is it 32-bit or 64-bit)
Jane, isn't it odd that that the Registry Key Read would not work?
Note that the default path on 32-bit PC will be C:\\Program Files\\Family Historian\\program\\fh.exe
You could also try Registry Key:-
HKLM\SOFTWARE\Calico Pie\Family Historian\2.0\Program Files Dir and append fh.exe
which must be accessible from FH as that is where it saves some Preferences.
Re: Quick Link Creator
Posted: 13 Aug 2017 10:14
by Jane
Colin, if you edit the batch file to use another folder does it then write the file, or is >> not supported in the emulator?