I was walking to my car when that idea comes to mind:
how many times did I spend to develop
And: is theres a development tool that compute a project ellapsed time (time ellapsed since the project was created, only when the project window is open on screen, of course) ?
Someone ?
dim start as new date
dim elapsed as new date
dim f as FolderItem = specialfolder.Applications.child("TextEdit.app").child("Contents").child("MacOS").child("TextEdit")
if f = nil then return
if not f.Exists then return
S1.mode = 0
S1.Execute(f.shellpath)
dim stopped as new date
elapsed.totalseconds = stopped.totalseconds-start.totalseconds
msgbox "You have used TextEdit for : "+str(elapsed.hour)+ " hours "+str(elapsed.Minute)+" and "+str(elapsed.Second)+" seconds."
The trick is to use shell mode zero on the Unix executable inside the bundle. It ties the calling app until the child process is terminated. For Xojo 2014 line 3 should read as follow :
dim f as FolderItem = specialfolder.Applications.child("Xojo 2014 Release 2.1").child("Xojo.app").child("Contents").child("MacOS").child("Xojo")
Of course if you have moved Xojo.app that path should be modified.
I forgot ; I usually place a shell class in the project. You should put
Dim S1 as new Shell
at the beginning of the code I posted.
Albin Kiland has an app on the MAS (£0.69p) - It’s called Aeon Timer:
I believe this may be what you are looking for - take a look on the MAS.
link text
The method I posted above is for Macintosh. It can probably work for Linux as well by just pointing to the executable, since Mac’s Unix and Linux have the same way of handling shell.
To do the same on Windows requires using the Completed event of the shell. Here is what to do.
- Insert a class into the project called S with super
Shell
.
- Drag an instance of the class to the window. It will automatically be called S1.
- Add the event Completed to S1
- Add a Date property to the window called start
Here is the code to launch the IDE for 2014R2.1. Attention, if you are still using XP, the folderitem is simply Applications.Programs ; I have indicated here the path for Windows 7 and 8/8.1 in which Xojo is installed in the folder for 32 bits applications Program Files (x86
.
start = new date
dim f as FolderItem = specialfolder.Applications.Parent.child("Program Files (x86)").child("Xojo").child("Xojo 2014r2.1").child("Xojo.exe")
if f = nil then return
if not f.Exists then return
S1.mode = 2
S1.Execute(f.shellpath)
In the S1 Completed
event :
dim elapsed as new date
dim stopped as new date
elapsed.totalseconds = stopped.totalseconds-start.totalseconds
msgbox "You have used Notepad for : "+str(elapsed.hour)+ " hours "+str(elapsed.Minute)+" and "+str(elapsed.Second)+" seconds."
Is it not funny ? Whenever there is something to correct, esotalk won’t let you edit… Grrr…
Please read “Xojo” instead of “Notepad” in the fourth line of the Completed event.
[quote=129502:@Richard Summers]Albin Kiland has an app on the MAS (£0.69p) - It’s called Aeon Timer:
I believe this may be what you are looking for - take a look on the MAS.
link text[/quote]
Nice app. It is unclear if it measures the time an app has been running, though. Could be a nice feature to add to his version 2 
[quote=129529:@Michel Bujardet]
Nice app. It is unclear if it measures the time an app has been running, though. Could be a nice feature to add to his version 2 :)[/quote]
It does not measure the time spent in an application. BUT, that was a good suggestion for a feature though 