![]() |
#1
|
||||
|
||||
![]()
Hey everyone,
I know this is probably an odd request... however I'm curious if it's possible! Is there a small bit of script that will time how long a .cdr file is open? I'd like the script to start running at open, and just before closing either write the time in the .cdr file, or a text file on the computer. Is this possible? We are making a "test" of sorts for all the designers in the company, and we need a indication of time it took to complete an example file... so my idea is to have it time from open to close, and save the result either within the corel file, or in an external text file! I'm pretty sure I can accomplish the saving the information part of it myself and embedding the VBA project in my corel file... but the "timer" function of things... I don't have the slightest idea about... Can anyone offer any insight? Much appreciated in advance! Thanks, B |
#2
|
|||
|
|||
![]() |
#3
|
||||
|
||||
![]()
hi michael! thanks for the info... i actually did stumble across this and found it to be quite interesting! However, this is a little more complex then what I need! I just need a timer for one file, and to be embedded in the .cdr file.
We have 23 designers spread out over north amercia, and I don't want to try and install software on all their computers to time them on one file! hahaha so something embedded in the file they are going to work on once, seems easier I think! I don't even know if it's possible... but thats why I've come here to ask the experts! ![]() Thanks, B |
#4
|
|||
|
|||
![]()
Well I had a similar problem but there is no timers as such...
So I needed to find a way of recording when a User was actually moving something within Corel Draw between our designers. Without posting my code, I describe what it does, it uses a mixture of routines from SelectionChange/NewDocument/OpenDocument/SaveDocument. When a user selects something from Corel it notifies the SelectionChange event, this then records what time this happened with GetTickCount() (google it), when the user moves something again it takes the difference between the two GetTIckCount routines. IF the user is idle for 1 minute it considers that time as non-chargable time, when the user 'saves' the document it stores this to a central database with an Insert SQL Stored Procedure. I have got this running on all our office PC's and can produce statistics on each file. It works quite well as it has been running for about 7 months without too much hassle. Delay Load option is set correctly as VBA needs to be active at Corel Startup. That Project recorder is interesting, bit late now to be looking at it lol. I hooked into Private Sub GlobalMacroStorage_SelectionChange() which is inside Corel Objects / ThisDocument |
#5
|
||||
|
||||
![]()
wow... see... sometimes it's the simplest things that work! I never even thought of just a simple "time stamp" of sorts. Just a record of when they opened the file, then closed it!
I don't have to worry about anything other then open and close! It's a test... so they will know they are being timed... the quicker they complete it the better! they only have one chance to work on it... so if they close it... they are done! so it's in their best interest to get it done quicker! so a simple time stamp at the beginning and end would suffice! I can do the math to calulate the time myself! Thanks for the info! B |
#6
|
||||
|
||||
![]()
You could also write a start and stop time to the registry with the Timer function. You would want it a little smart I guess, so every document you opened didn't keep writing over the timer. So here is what I came up with. First you need to start the timer, this would go in your OpenDocument Event like this:
Code:
Private Sub GlobalMacroStorage_DocumentOpen(ByVal Doc As Document, ByVal FileName As String) If GetSetting("MyTimer", "Timer", "CloseTimer") = "" Then SaveSetting "MyTimer", "Timer", "OpenTimer", Timer End If End Sub Code:
Private Sub GlobalMacroStorage_DocumentClose(ByVal Doc As Document) If GetSetting("MyTimer", "Timer", "CloseTimer") = "" Then SaveSetting "MyTimer", "Timer", "CloseTimer", Timer End If End Sub Code:
Sub CalcTimer() MsgBox "The document was open: " & Round(GetSetting("MyTimer", "Timer", "CloseTimer") - GetSetting("MyTimer", "Timer", "OpenTimer"), 2) & " seconds" End Sub Code:
Sub ClearTimers() SaveSetting "MyTimer", "Timer", "OpenTimer", "" SaveSetting "MyTimer", "Timer", "CloseTimer", "" End Sub Hope that helps and if you have question, please ask! -Shelby |
#7
|
||||
|
||||
![]()
wow... i'm definately going to give this a try! thanks for the info! I'll let you know what happens!
B |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Odd square characters | Beatniks | CorelDRAW/Corel DESIGNER VBA | 4 | 23-04-2007 23:38 |
Viewer for .CDR files | Alex | FAQ | 2 | 27-12-2006 16:06 |
Show default icon for CDR files in Windows Explorer | Alex | FAQ | 0 | 27-04-2005 12:10 |
CW 4.1 features request | Denis Korotkov | Calendar Wizard | 3 | 13-09-2004 08:44 |
help me, even or odd, | dominiqueL | CorelDRAW/Corel DESIGNER VBA | 2 | 18-10-2003 01:19 |