It is currently April 19th, 2024, 6:00 am

Get last ShareX screenshot path

Get help with creating, editing & fixing problems with skins
User avatar
Lanteust
Posts: 8
Joined: March 20th, 2020, 2:57 pm
Location: France

Get last ShareX screenshot path

Post by Lanteust »

Hello,
I'm trying to do a small skin that shows the last ShareX capture.

The ShareX Folder works that way:

Code: Select all

%UserProfile%\Documents\ShareX\Screenshots\{Folder per month}\{Capture}.png 
At first I was trying to use a little .bat script that I launch by doing right click on the skin, but well, it's a bit boring to use.

Code: Select all

@echo off

::SET ShareXFolder="$env:UserProfile\Documents\ShareX\Screenshots"
SET ShareXFolder=%UserProfile%\Documents\ShareX\Screenshots
SET mypath=%~dp0
FOR /F " tokens=*" %%i IN ('dir %ShareXFolder% /b /ad-h /od') DO (SET folder=%%i)  
FOR /F " tokens=*" %%i IN ('dir %ShareXFolder%\%folder% /b /od') DO (SET file=%%i)  
copy %ShareXFolder%\%folder%\%file%  "%mypath:~0,-1%"\ShareX.png
Then i tried to do the same with the plugin FileView with an update, but it's not working...

Code: Select all

[Rainmeter]
Update=1000
Background=#@#Images\Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
Name=Derniere capture ShareX

[Includes]
@includeSettings=#@#Includes\Settings.inc

;___TITLE___
	[MeterTitle]
	Meter=String
	MeterStyle=styleTitle
	X=100
	Y=12
	W=150
	H=18
	Text=Share X
	LeftMouseUpAction=["taskmgr.exe"]
	ToolTipText=Open Task Manager



[Variables]
ShareXFolder="%USERPROFILE%\Documents\ShareX\Screenshots\"

[MeasureShareXFolder]
Measure=Plugin
Plugin=FileView
Path=#ShareXFolder#
Count=1
Recursive=1
ShowFolder=1
ShowFile=0
SortAscendingDefault=0
SortDateTypeDefault=Created
SortTypeDefault=Date
UpdateDivider=5

[MeasureShareXFolderChild]
Measure=Plugin
Plugin=FileView
Path=[MeasureShareXFolder]
Type=FolderPath
Index=1
Group=Children

[MeasureShareXFolderChildName]
Measure=Plugin
Plugin=FileView
Path=[MeasureShareXFolder]
Type=FileName 
Index=1
Group=Children

[MeasureShareXFolderChildPath]
Measure=Plugin
Plugin=FileView
Path=[MeasureShareXFolder]
Type=FilePath 
Index=1
Group=Children

[MeasureShareXLastFolder]
Measure=Plugin
Plugin=FileView
Path=[MeasureShareXFolderChild]
Count=1
Recursive=1
Extensions="png"
ShowDotDot=0
ShowFolder=0
SortAscendingDefault=0
SortDateTypeDefault=Created
SortTypeDefault=Date
UpdateDivider=5

[MeasureShareXLastFolderChildName]
Measure=Plugin
Plugin=FileView
Path=[MeasureShareXLastFolder]
Type=FileName
Index=1
Group=Children

[MeasureShareXLastFolderChildPath]
Measure=Plugin
Plugin=FileView
Path=[MeasureShareXLastFolder]
Type=FilePath
Index=1
Group=Children



;___ShareX___
	[MeterShareXImage]
	Meter=Image
	ImageName=[MeasureShareXChildPath]
	X=#xImage#
	Y=(2*#yOffsetLine#)
	W=#wProcess#
	LeftMouseUpAction=["#ShareXFolder#"]
	RightMouseUpAction=[!CommandMeasure MeasureFolder Update]
	
I'm trying to get the last created folder, then the last created capture... but when i look at the measures i get nothing.

I think i'm missing something.

If anyone got any idea :Whistle
You do not have the required permissions to view the files attached to this post.
Last edited by Lanteust on June 26th, 2020, 3:22 pm, edited 1 time in total.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Get last ShareX screenshot path

Post by mak_kawa »

Hi Lanteust

I think...Recursive=2?
User avatar
Lanteust
Posts: 8
Joined: March 20th, 2020, 2:57 pm
Location: France

Re: Get last ShareX screenshot path

Post by Lanteust »

Well, with Recursive=2 it's a little bit better (way better) :rosegift:

Start by removing everything that was false... like the default from copy/paste from the doc... :oops: or useless to me... so nearly everything.

Code: Select all

[Rainmeter]
Update=1000
Background=#@#Images\Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
Name=Derniere capture ShareX

[Includes]
@includeSettings=#@#Includes\Settings.inc

;___TITLE___
	[MeterTitle]
	Meter=String
	MeterStyle=styleTitle
	X=100
	Y=12
	W=150
	H=18
	Text=Share X
	LeftMouseUpAction=["taskmgr.exe"]
	ToolTipText=Open Task Manager



[Variables]
ShareXFolder="%USERPROFILE%\Documents\ShareX\Screenshots\"

[MeasureShareXFolder]
Measure=Plugin
Plugin=FileView
Path=#ShareXFolder#
Count=1
Extensions="png"
Recursive=2
ShowFolder=1
ShowFile=0
SortAscending=0
SortDateType=Created
SortType=Date
UpdateDivider=5

[MeasureShareXFolderChild]
Measure=Plugin
Plugin=FileView
Path=[MeasureShareXFolder]
Type=FolderPath
Index=1
Group=Children

[MeasureShareXFolderChildPath]
Measure=Plugin
Plugin=FileView
Path=[MeasureShareXFolder]
Type=FilePath 
Index=1
Group=Children



;___ShareX___
	[MeterShareXImage]
	Meter=Image
	MeasureName=[MeasureShareXFolderChildPath]
	ImageName=%1
	X=#xImage#
	Y=(2*#yOffsetLine#)
	W=#wProcess#
	LeftMouseUpAction=["#ShareXFolder#"]
	RightMouseUpAction=[!CommandMeasure MeasureShareXFolder Update]
	
Why does [MeasureShareXFolderChild] still is at the root of my FileView, it's not supposed to be a path to 2020-06 ?

Now it's time to try to have the picture loaded in the skin :D
You do not have the required permissions to view the files attached to this post.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Get last ShareX screenshot path

Post by mak_kawa »

Hi Lanteust

I am not sure about your aim... but MeasureName=MeasureShareXFolderChildPath, instead of MeasureName=[MeasureShareXFolderChildPath], in the [MeterShareXImage] meter??
User avatar
Lanteust
Posts: 8
Joined: March 20th, 2020, 2:57 pm
Location: France

Re: Get last ShareX screenshot path

Post by Lanteust »

It's working with MeasureName=MeasureShareXFolderChildPath . :great:

It's still a bit of a mystery why sometimes we need to add the brackets and sometimes we don't.

I love to do a screenshot, do something else, and when I need it's not in my clipboard anymore.

I want a skin that shows me my last capture, without me needing to reload the skin every time...
With my left click going to the folder 2020-06 and the right click adding it to my clipboard.

But first thing first, I just wanted to show the capture, that is now working...
Now I want to open the right subfolder with my left click.
Next I want to update every i don't know, 5 min or so to not overload with useless scans.
And then add the picture to the clipboard.

Code: Select all

[Rainmeter]
Update=1000
Background=#@#Images\Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
Name=Derniere capture ShareX

[Includes]
@includeSettings=#@#Includes\Settings.inc

;___TITLE___
	[MeterTitle]
	Meter=String
	MeterStyle=styleTitle
	X=100
	Y=12
	W=150
	H=18
	Text=Share X
	LeftMouseUpAction=["taskmgr.exe"]
	ToolTipText=Open Task Manager



[Variables]
ShareXFolder="%USERPROFILE%\Documents\ShareX\Screenshots\"

[MeasureShareXFolder]
Measure=Plugin
Plugin=FileView
Path=#ShareXFolder#
Count=1
Extensions="png"
Recursive=2
ShowFolder=1
ShowFile=0
SortAscending=0
SortDateType=Created
SortType=Date
UpdateDivider=5

[MeasureShareXFolderChild]
Measure=Plugin
Plugin=FileView
Path=[MeasureShareXFolder]
Type=FolderPath
Index=1
Group=Children

[MeasureShareXFolderChildPath]
Measure=Plugin
Plugin=FileView
Path=[MeasureShareXFolder]
Type=FilePath 
Index=1
Group=Children



;___ShareX___
	[MeterShareXImage]
	Meter=Image
	MeasureName=MeasureShareXFolderChildPath
	ImageName=%1
	X=10
	Y=40
	W=190
	H=110
	LeftMouseUpAction=["#ShareXFolder#"]
	RightMouseUpAction=[!CommandMeasure MeasureShareXFolder Update]
	
You do not have the required permissions to view the files attached to this post.