Is this doable at a newbie level?
bobs at twft.com
Fri Jan 14 18:51:43 CST 2011
If you look in the Dictionary, under date you will find several items, the date function, the dateFormat function, the datetime keyword, and the dateItems keyword. Also, if you look for clipboard you will find the clipBoardData property.
Between all this and some experimentation you should be able to come up with a button that will take the current date and or time in whatever format you desire and set the clipBoardData to that.
Note that setting properties is not the same syntax as creating or altering variables. You set a property using the set command. You alter variables by using the put into form.
If you wanted to get really fancy, you could build an appleScript into a variable and then do as appleScript to query the system for the foreground application and then tell that application to paste after all that. But that's just for extra credit.
Your stack should have it's systemWindow property set to true, but this will only float it above other LiveCode stacks. I don't think there is a way to make it float above every application in the OS, but I might be wrong there.
I don't think this will take long for you to do if you try. Dropping the date/time into a selected field of another LiveCode stack would be easy. If you want to drop a date/time stack at the cursor of another application, that could prove more difficult.
On Jan 14, 2011, at 4:29 PM, Calvin Waterbury wrote:
> The below features list is for a small utility I *need* right now, but I can wait long enough to code it. ;)
> Please, resist the urge to whip out the code and post it. I want to try something myself. I *know* this can be done in LC. What I am asking is if you think the following can be done by a newbie to LC?
> Thanks, Calvin
> PS - Don't go away... I may *need* you to "whip out" some syntax later! Here's the list...
> Here is a list of requested features...
> * "Always On Top" option
> * Three Buttons.
> o Date
> o Time
> o Date and Time
> + The "Date and Time" button to include date, at least in this specific format, but others can be included...
> "Nov 15, 2010 02:43 PM" (color only for reference, not needed in app.)
> Please ask me for other formats, if you want to include them?
> * Optional Radio buttons to select Date/Time formats *if* you have the time and inclination. The Date & Time format above,"Nov 15, 2010 02:43 PM," is my only immediate need.
> o "Date & Time" Mmm DD, YYYY HH:MM AM (the same as the above exact example that is really the most important format.)
> o Another Date format MM/DD/YY (Example: 01/14/11)
> o Time format 1: HH:MM (24 Hr Clock)
> o Time format 2: HH:MM AM (12 Hr Clock)
> o YYYYMMDDHHSS - I use this to prefix file names as a simple date tagging system.
> * It would be nice to be typing in a text editor and just click the "Insert Date" button and populate it in the document I am working on, but I can settle for sending it to the clipboard if that is all that can be done easily.
> * Small footprint
> o Just big enough for the radio buttons (for the format selections) and the three "Date," Time" and "Date & Time" insertion buttons.
> o Menu in Right-Click menu, if easier.
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode