'OnCanRunProfile' not working

English Support for Syncovery on Windows.
Post Reply
PeterC
Posts: 26
Joined: Thu Jan 05, 2023 11:18 pm

'OnCanRunProfile' not working

Post by PeterC »

I have 2 profiles that I don't want to run at the same time. The profile names (taken from the 'Rename Profile' dialog box) are:
• p1 "[chn00] C:\(slctd,excl)--SamsungT7-L:\UserData" &
• p2 "[chn20] SamsungT7-L--Wombat (sleep)"

I have them in different 'Profile Groups' as shown in the below screenshot.
20250712 OnCanRunProfile.jpg
20250712 OnCanRunProfile.jpg (42.62 KiB) Viewed 14 times
In Program Settings > Advanced > Global Pascal Script for All Profiies... I have the script:

Code: Select all

const p1='[chn00] C:\(slctd,excl)--SamsungT7-L:\UserData';
      p2='[chn20] SamsungT7-L--Wombat (sleep)';

function OnCanRunProfile(const ProfileName:UnicodeString; var PostponeBySeconds:Integer):Boolean;
begin
  if ProfileName=p1 then
     Result:=not ProfileRunning(p2)
  else
     if ProfileName=p2 then
       Result:=not ProfileRunning(p1)
     else
       Result:=true;
  if not Result then
     PostponeBySeconds:=60;
  end;
My problem is I'm still getting these 2 profiles running simulateously.
Post Reply