Jane, I have discovered a snag with this Plugin, associated with OneDrive, but also if Desktop is relocated by user.
A relatively new feature in OneDrive allows the Desktop to be saved.
This is done via OneDrive > Settings > Auto-save tab Update folders button.
But when enabled the default Desktop path changes from C:\Users\<username>\Desktop to C:\Users\<username>\OneDrive\Desktop or wherever OneDrive folder happens to be, and in any case a user can relocate their Desktop folder.
So the solution is to retrieve the Desktop path from the Windows Registry at:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Desktop
So in Plugin use:
local filepath,err = getRegKey('HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Desktop').."\\"
* Create Individual Shortcut Plugin
- tatewise
- Megastar
- Posts: 28341
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Create Individual Shortcut Plugin
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Jane
- Site Admin
- Posts: 8508
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Create Individual Shortcut Plugin
I used your example on my PC and it returned
%USERPROFILE%\Desktop\
which failed as a location to store files. I assume your PC is returning a full path?
Ok, I 'll try and look at some point, I don't use OneDrive as I wouldn't trust Microsoft's Cloud with anything important.
%USERPROFILE%\Desktop\
which failed as a location to store files. I assume your PC is returning a full path?
Ok, I 'll try and look at some point, I don't use OneDrive as I wouldn't trust Microsoft's Cloud with anything important.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- Jane
- Site Admin
- Posts: 8508
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Create Individual Shortcut Plugin
This works on mine, does it work with one drive.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- tatewise
- Megastar
- Posts: 28341
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Create Individual Shortcut Plugin
Yes, that works fine, and yes for me the Registry key returns a full path without %USERPROFILE%.
Note that this copes with any user who relocates their Desktop folder not just the OneDrive scenario.
Perhaps need to test err variable, as you do later for Get Path to FH.
But I guess Plugin would have to abort if the getRegKey(...) fails.
Note that this copes with any user who relocates their Desktop folder not just the OneDrive scenario.
Perhaps need to test err variable, as you do later for Get Path to FH.
But I guess Plugin would have to abort if the getRegKey(...) fails.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Jane
- Site Admin
- Posts: 8508
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Create Individual Shortcut Plugin
I have added just a check for fail and set the parameter to the default value if the key read fails.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- tatewise
- Megastar
- Posts: 28341
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Create Individual Shortcut Plugin
Looks good to me.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry