Create a timer to make a variable for pause length from user input

I have an external task that varies in time based on the machine I am using, yet once that value is determined, it will remain the same while on that machine. I need to have an Applescript perform a task based on that time variable. This a repeating loop script that will need user input for the first iteration of the loop. How can I get this time variable to use in the script? I would like it to be something like this.
--script clicks OK button in the app (this is already scripted)
--timer started
--script throws up a dialog instructing user to click OK when hardware specific task is completed (has a cancel option to cancel script as well)
--when dialog box OK is clicked a time value is determined between the timer started and the dialog OK click
--time value is now a variable to call for pause between loop cycles, requiring no more user input (except an overall script cancel if needed)
is this possible?
PowerBook G4 Titanium 500 Mhz   Mac OS X (10.4.2)  

Yeah, it's possible. There are probably a couple ways to do it. Here's a quick one that uses a unique hardware ID. Properties persist between runs, reboots, etc. but not compiles.
click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">property delay_time : missing value
property last_mac : missing value
set test_mac to primary Ethernet address of (system info)
if test_mac is last_mac and delay_time is not missing value then
-- performclickhandler()
delay delay_time
else
set start_time to (current date)
-- performclickhandler()
display dialog "Click OK to set the timer..."
set delay_time to (current date) - start_time
set last_mac to test_mac
end if
-- rest of your script
</pre>

Similar Messages

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • How to deploy a VO Bind variable to get value from user session....

    Hello everbody...
    A JSF Page has a table based on VO with two parameters. One of this parameters I will pass by operation ExecuteWithParams.
    but the other parameter I need to pass a value from User session.
    Is that possible? How would I do that? I´m using jdev10.1.3
    Thankyou...

    When you created a binding for executeWithParams in your pageDef, the action binding should have had NamedData elements for each of the parameters. These would have been assigned values from a variableIterator up in the executables section. The parameter that gets its value from user input should be left alone. For the parameter that gets its value from the user session, change the EL expression that defines its NDValue attribute so that it references the session information that you want to use. This can be a sessionScope variable that you set earlier in the session, as Frank suggests, a property of a managed bean in session scope, or some other variable.

  • Table for Valuation Price from USER EXIT - Cost Estimation

    Hi All,
    Can you let us know from where the system picks the price for VALUATION PRICE from USER EXIT when we have following setting in valuation variant
    1.Valuation Price from USER EXIT
    2.Price from Purchasing Info Records
    3. Planned Price 1
    Sub Stratergy.
    1.Effective Price from Purchase Order
    2. Net Quotation Price
    3. Gross Quotation Price.
    Now when we execute CK11N for a material, the system displays a cost price as 316 Euro/ unit.
    But Standard price is 290 euros, info record price is 294 euros & planned price 304 euros.
    Our previous cost estimation ( period 1, current period is 5) was 316 euro/unit (which was not correct), so deleted the cost estimation with CKR1 and try to rerun the cost estimation to update the value (new price), but still the system is picking the old price.
    Can you let us know from where does(transaction code & table) the system is picking the old values.
    In CK11N Material valuation (Valuation tab) its showing as Valuation Price from USER EXIT.
    We have activated Material Ledger with price control "s"and we in ECC 6.0.
    Do suggest.

    Hi,
    Where & how can i find the exit.
    Do suggest.
    Regards,

  • How to create real time chart with candle stick for displaying Open, High, Close, Low values from BSE/NSE EOD data

    Please help with sample windows form C#.Net Example

    Hi Goutam,
    Please refer to the following link with examples: http://www.codeproject.com/Questions/234865/create-real-time-chart
    Hope this helps you!
    Regards,
    Mitch!

  • Time machine makes 30 backups for the last two days, no backups for any earlier times: is there a way to control it?

    I've been running Time Machine in the background for as long as I've owned my current Mac--- a few months.  It is a completely generic set-up: it's a desktop (rarely shut off or asleep) connected to an external hard drive that is much larger (1 TB) than my internal hard drive (0.5 TB), and Time Machine is configured to save backups of my whole internal drive to the external drive.  The external is half-full, and the internal is a little more than half-full.  I often hear my external crunching away, working on something.
    I recently needed to access an old file, so I went into Time Machine mode on the folder where it had been deleted a few weeks ago.  While I'm not upset that it isn't available (it's my own fault for deleting it), I didn't expect the Time Machine to have such a bad distribution of saved backups.  There are 30 backup snapshots of the past two days, and nothing earlier.  I was expecting something more like a few from today, a few from this week, a few from this month, and a few going all the way back in time--- a broader distribution.
    I don't see any way to control this in the Time Machine Preferences (in fact, very little control at all).  Is there a secret way to control it, or some tip to ensure a more useful distribution of saved snapshots?
    Thanks,
    -- Jim

    Thanks, but it doesn't exactly address my question.  TimeMachineEditor allows me to set the intervals or times when backups occur, but it doesn't control the algorithm that decides which snapshots should be deleted.  My problem was that Time Machine chose to delete all of the old snapshots and keep only the most recent ones: I'd like it to keep more of the recent ones than the old ones, but still keep some old ones.
    In fact, the (unmodifyable) text on the Time Machine control panel says that it keeps:
    hourly backups for the past 24 hours
    daily backups for the past month
    weekly backups for all previous months
    That would be perfect if it were true.
    Perhaps the algorithm did the wrong thing because the size of my internal hard drive varied quite a lot a few days ago: a process got out of control and used up all of my internal disk space.  I killed the process and deleted its output (several times), so my internal disk eventually went back down to normal.  Perhaps in the intervening hours, Time Machine made a backup, once an hour, and used up all of the external drive space.  When it had to choose between keeping "weekly backups of previous months" and "hourly backups of the past 24 hours", it chose to keep hourly backups of the past 24 hours.  This was the wrong choice in my case (it was the unwanted output) and is probably the wrong choice in most cases.
    Is there a way to control the algorithm that decides which backups to keep and which to delete?  I would have it delete the hourly, daily, and weekly backups in a way that preserves their relative distribution.
    By the way, while I have made it sound like my problem was a runaway log file (something that would be easy to put in an excluded directory with Time Machine's "Options" button), it was a VirtualBox snapshot merge.  The data in question are precious, but were unnecessarily copied many times while VirtualBox failed to merge them properly.  I can't simply exclude a directory: I'm talking about a more general problem.
    Thanks!
    -- Jim

  • Variable for navigational attribute affected fiscper input variable

    Dear Friends
    Initially, the query is having an input variable for fiscper. The query was able to run properly.
    When i add a input variable for a navigational attribute to the same query which is based on multiprovider, the fiscper input variable is no longer  seen.
    So, I removed the global filter for the navigational attribute and it is ok again.  I fixed a value for the navigational attribute at filter level is also fine.
    Please advise what could be the cause. Thank you so much.
    Best regards
    Bass

    Hi Bass,
    Again seems to be a strange issue, if you have two independent characteristic with two different input enabled variables then there is no reason for the variable to not to show up on selection screen.
    Once you add the new variable and save the query just make sure that you have earlier variable as it is and check the query properties popup and see the fiscper variable sequence in the variable list.
    Regards,
    Durgesh.

  • How do I re-set the old IPad to make it ready for a brand new user? Is it simply the Restore command in ITunes?

    Purchased an IPad 2 and will be giving my first generation IPad to my wife. What is the easiest way to re-set the old IPad to make it ready for a new user?
    Is it simply the Restore command in ITunes?

    Do a full sync/ back up of the old one first.  Then you can sync the new one to the old backup.  When you are all ready, on the i pad, goto system . General . Reset.  and select erase all content.  Turns the old one into out of the box condition.

  • Use of Shared Variables for data transfer from a RT traget to a desktop application

    Hi,
    I want to adopt the shared variables to share data in an existing distributed application comparable with the T3 Benchmark configuration in this document:
    [1] http://zone.ni.com/devzone/conceptd.nsf/webmain/5B4C3CC1B2AD10BA862570F2007569EF
    The current implementation uses a well tuned solution with RT FIFOs and TCP/IP communication with a desktop-PC which monitors and stores the data.
    The desktop application runs with a much slower execution rate than the TCL. So the TCP/IP packets are used to buffer the data with a package size dependent on the data send rate.
    To use the shared variables instead of this RT FIFO + TCP/IP implementation I need to read the shared vairable buffer at once each time the desktop application reads the shared variable.
    But according to this quotation from [1]:
    "With buffering, you can account for temporary fluctuations between read/write rates of a variable. Readers that occasionally read a variable slower than the writer can miss some updates."
    this seems to be impossible. Am I right?
    Are there any suggestions to circumvent this problem? Or are shared variables not made to share data between unsynchronized processes without data loss?
    Regards Till

    You can use the error-cluster to detect the end of your queue. The erroroutput of the shared variable will return a -2220 Warning, if it reads a value it has read already before. I attached a modified example and saved it for 8.2 I hope you can open it.
    Attachments:
    readbuffered82.zip ‏51 KB

  • How can I make tree view for hierarchical data from select with connect by?

    If we have selected hierachy with connect by clause, how can we make it to see in tree view?

    You can't do this using the ADF, Tree Binding used by JHeadstart.
    However, If you have a recursive relationship (for example managerid) you can get a tree what you want as follows:
    - create one root ViewObject that returns the top-level employees without a manager by setting the where clause to managerid=null
    - create a second ViewObject that simply queries all employees
    - Create a ViewLink between the two view objects, and create a nested VO usage in the app module for the second view object
    - Create corresponding nested group in the application definition file and set the layout style to "tree-form" on both groups.
    See Developers Guide, chapter 3, section recursive trees for more info.
    Steven Davelaar,
    JHeadstart Team.

  • SMB makes life unbearable for AFP network directory users

    We have a an XServe/XServe RAID combo running 10.4.11 acting as a home directory server for around 20-30 simultaneous users. Most use network home directory accounts served by AFP to desktop Macs. A handful use PCs (SMB access) or Linux boxen (NFS access).
    Some patterns of SMB usage render the network accounts almost unusable: a spinny cursor of doom, and long periods of sluggishness or inactivity. Meanwhile, on the server, smbd uses 100% of one of the cores.
    This is not necessarily associated with high network traffic - even light data transfer by SMB peaking at 200kB/s can have this effect. We're on a mixed 100 base-T/gigabit network, so we're not reaching anywhere near saturation. High-bandwidth access via NFS is barely noticeable to AFP users.
    - Can people recommend further diagnostic approaches?
    - Can SMB on the XServe be tuned to avoid this?
    - Is there anything else I can do to avoid the problem?
    TIA

    Apologies for the double-post. I blame SMB.

  • Dynamic sql query for report based on user input

    Hi everyone,
    I have built custom search fields (name, date born, gender etc.) in the search region and in the results region a report need to be displayed.
    Now I'm not very experienced with Apex or Oracle sql, but could anyone telll me how to first check if a user filled in a field and then build a query based upon what field the user filled in to submit.
    Any help would be appreciated, thanks in advance.
    regards,
    Cleo
    Edited by: Cleopatra on Jan 18, 2011 5:51 AM

    Hi, Cleopatra. Welcome to OTN!
    If you don't have too many fields instead of checking to see if they're filled in you can use OR conditions in yoru WHERE_CLAUSE to check for NULLS to ignore NULLS, something like (you will have to test this carefully!)
    AND some_column = NVL(:P24_1,some_column)the idea being that if the field is NULL then the column will match itself - in this case assuming the column itself does not have a null value

  • Variable for 0FISCPER displays od values

    Hi
    I have created a query containing a interval variable for 0FISCPER. The Query is based on a multiprovider that is build on a single ODS containing WBS line items loaded through 0CO_OM_WBS_6. When the query is run and the variable box appears I press the selection button for 0FISCPER. It displays som od values for selection that does not exist in the ODS. fx. 001.0010. When i select such a value it is converted to 001.2010. The ODS only contain data for 2003-2006.
    Can you help me to understand what causes this, so i am able to fix it.
    Chris

    1.     On the Administrator Workbench: Modeling screen:
    a.     Choose Source Systems.
    b.     In the right hand window select the source system from which you would like to transfer the global settings.
    c.     From the context menu choose Transfer global settings.
    2.     On the Transfer global settings: Selection view in the frame Transfer global table contents select the checkboxes for the settings you want to use from your R/3 source system:
         Fiscal year variants to transfer fiscal year variants
    3.     In the frame Mode choose Update Tables.
    4.     Choose Execute.
    5.     Choose Back twice.
    Then try your reporting......

  • How to create a time event without having user interface freeze

    Hi,
    I am new to labwindows and i am trying to create a time event where every hour for 24 hours i want my program to write somethign in excel. 
    I tried using function Delay and SyncWait and those functions freezes up the user interface.
    Any tips/help will be appreciated.
    Thank You
    Solved!
    Go to Solution.

    Many, if not most, CVI developers wind up implementing a delay function for themselves that periodically, during the delay, wakes up and processes events so that the GUI isn't frozen.
    The idea is to break the wait or delay up into pieces, and process system events in between each piece.
    A timer works too, you can try the async timer that Wolfgang mentioned, it runs a bit better and on a separate thread, so it lets you do what you normally would with the main thread and the GUI, yet still get timer function.   If you use a smart delay, you still wind up doing nothing a great deal of the time, and events are only processed periodically.

  • Variable used in FOx formula should get value from user

    Hi Gurus,
    In my fox formula I want to multiply a keyfigure (say quantity) with a factor. For example if the factor is 10 then all records should get multiplied by 10.
    But the requirement is user shpuld be able to give the factor that should be multiplied. That is the l_factor used in the fox function should be a variable which gets value from user. I know we can give variables in filter and planning functions in IP. But can we give values in Fox formula.
    I would really appreciate the time and effort.
    Thanking you,
    Jerry Jerome

    Hello,
    May be you can try this solution.
    I think you have create a dummy character info-object(Z_Number) of same data type interget number.Create variable for Z_Number and restrict in filter(ZV_NUM).
    DATA Z_MAT TYPE 0Material.
    DATA Z_NUM TYPE Z_NUMBER.
    DATA Z_NUM_READ TYPE I.(Declate same as data type for Z_Number)
    Z_NUM = VARV(ZV_NUM).
    FORACH Z_MAT.
    Z_NUM_READ = Z_NUM.
    {Z_KF1,Z_MAT} = Z_NUM_READ * {Z_KF1,Z_MAT}.
    ENDFOR.

Maybe you are looking for

  • Powerbook won't boot up! Please help

    So here is the story. I recently cracked the screen on my 12" Powerbook on my way to school, so I have been looking for a replacement for a while now. I found someone on craigslist who was selling the exact same powerbook but the motherboard/logic bo

  • Can't print to PDF from Office 2004

    I have a new MacBook 2 GHz with 2 G RAM and 40 G available on my hard drive. I flawlessly transfered the data from my G3 ibook and everything was going great. I went to print on Word 2004 and the "print to PDF" and "cancel" buttons were missing. Open

  • File not found:  includes/common/lib/file_upload/KT_FileUpload.asp Please upload the includes/ folder to the testing server.

    The cooperative I am a part of have a homepage made with Dreamweaver several years ago. Suddenly some of the pages stopped working with this error message: File not found:  includes/common/lib/file_upload/KT_FileUpload.asp Please upload the includes/

  • I need help setting up file sharing with my MBP and a PC

    i have been trying to set up file sharing so I can move files on my windows PC (music, pic's, office, pdf, etc..) to my new MBP.  I followed all the directions, but still cannot see the MBP on the PC.  I had it working a few days ago by setting up th

  • Poor quality image with doing videos with photos/images HELP!

    Hello, I bought Adobe Premiere Element to make videos with pictures. When I do the video, the quality of my photos is good. When I save the video on my computer or I download it on youtube (example) the quality of my photos is extremely poor. Why? Do