SV: Startup script not working
SV: Startup script not working
- Subject: SV: Startup script not working
- From: Gunno Ivansson <email@hidden>
- Date: Mon, 09 May 2005 09:51:49 +0200
Thanks very much Andrew, now it works
Gunno Ivansson
Den 05-05-09 09.03, skrev "Andrew Oliver" <email@hidden>:
> On 5/8/05 11:34 PM, "Gunno Ivansson" <email@hidden> wrote:
>
>> I am trying to save boottime to a file at start up, but it's not working.
>> Here is my script, it is saved as an application and added to my account's
>> start up items.
>>
>> property gCurrentDate : (current date)
>> property myFilePath : (path to documents folder from user domain as text) &
>> "Flex:BootTime" & ((day of gCurrentDate) as string) & ((month of
>> gCurrentDate) as string)'s text 1 thru 3 & ((year of gCurrentDate) as
>> string) & ".txt"
>>
>>
>> on run
>> try
>> alias myFilePath
>> on error
>> set myPosixPath to POSIX path of myFilePath
>> do shell script "/usr/sbin/sysctl kern.boottime > " & myPosixPath
>> end try
>> end run
>
> IIRC, you can't use a property like this. The property isn't processed at
> runtime, rather at compile time so it'll continually try to write to the
> filename based on when the script was compiled.
>
> In order to be dynamic, using the script execution time you'll need to set
> myFilePath at runtime by including it in your run handler.
>
> Andrew
> :)
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden