Time + 2 Seconds

hallo,
I have this in my script:

set durationString to item 3 of argv
set outpunkt_time to time of date durationString

This works, but I need to add 2 seconds to the output_time.
I tried this:

set durationStringPlus to durationString + (2 * seconds)

This fails woth the following exception:
Can’t make seconds into type number. (-1700)

This is probably very easy to solve. Can someone give me a hint how to get the 2 seconds added?

I do not know exactly what item 3 of argv looks like, it comes from a python script, but I assume it must be a datetime, otherwise the setting of outpunkt_time would not work, right?

Thanks for your help,
regards

Ute

Hi Ute,

like in the real life you can do math only with numbers :wink:
So you have to coeece the string to a number, do the addition and coerce it back to text


property durationString : "12345"

set durationStringPlus to ((durationString as integer) + 2) as text
--> "12347"

Note: the unit seconds is not needed, because seconds is the basic unit in AppleScript