toggle playPause for iPhoto, script problem, probably global variable
I solved my problem, global variable was reset, now I store variable in file, here is the code:

set thePath to (get path to scripts folder from user domain as text) &amp; “myTempFile.scpt"

script theData
    property IsPaused : missing value
end script

try
    set theData to load script file thePath
on error
    set IsPaused of theData to false
end try

tell application "iPhoto"
    if slideshow running then
        if isPaused of theData then
            resume slideshow
        set isPaused of theData to false
        else
            pause slideshow
            set isPaused of theData to true
        end if
    else
        start slideshow
    set isPaused of theData to false
    end if
end tell

store script theData in file thePath replacing yes
return IsPaused of theData