This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Script Folder View folder

Tags: None
(comma "," separated)
airdrik
Registered Member
Posts
1854
Karma
5
OS

Script Folder View folder

Fri Mar 12, 2010 11:25 pm
I would like to script the location of a Folder View so that it points to a different directory each day.
Specifically, we have a file share where we keep daily data in dated folders (in a specific format), and I would like the folder view to keep up-to-date with the current one which is named for the previous week day (yesterday, unless yesterday was a Saturday or a Sunday, in which case it would be last Friday).
I would like this updating to occur on plasma startup and at a scheduled time (midnight) each day.

Of interest for any solutions is that I'm running KDE on Windows, so my use of *nix utilities is very limited.


airdrik, proud to be a member of KDE forums since 2008-Dec.
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS

Re: Script Folder View folder

Sat Mar 13, 2010 7:04 am
Not sure if it works, but maybe you can use a symbolic link and make a script that changes the target. As far as I know NTFS symbolic links were introduced in Windows Vista.


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Script Folder View folder

Sat Mar 13, 2010 8:45 am
A Plasma javascript would most certainly be capable of this, however I am not sure how one would write the script having not done it myself. You may wish to check the Javascript documentation on Techbase.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
airdrik
Registered Member
Posts
1854
Karma
5
OS

Re: Script Folder View folder

Mon Mar 15, 2010 7:43 pm
Looking at Techbase (http://techbase.kde.org/KDE_System_Admi ... pScripting), I was able to put together a Javascript that will do what I want, however two of the ways it says you can run the scripts are one-time-only deals (either when the application runs for the first time with no config, or if the path to the script isn't in the Updates group of the application's config), whereas I want this to run once-a-day everyday. (as a side note, the interactive console for writing and running javascripts has a couple of bugs on Windows that basically dissallows one from opening already-written scripts).

As for symbolic links - apparently Symbolic and hard links are only available in Vista and later versions of NTFS. In WinXP, there are Junctions, but you still need a 3rd party program or the paid-for Windows resource kit to make them. (for now, at least) I'm not going to bother.


airdrik, proud to be a member of KDE forums since 2008-Dec.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Script Folder View folder

Tue Mar 16, 2010 4:40 am
Can you please file a bug regarding the interactive console being able to open already written scripts?

As a workaround to not being able to run your script daily, you could write a small plasmoid using javascript which would simply invoke that script upon its startup.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar