How Do I Use SKProgressBar 1.8?

Continuing the discussion from Hide Application Enhanced Progress bar:

Just downloaded SKProgressBar Ver 1.8 and I get an error with its demo script, running Script Debugger 7.0.11 (7A106) on macOS 10.14.6 (Mojave):

SKProgressBar 1.8 Error

SKProgressBar got an error: Can’t set «class hDsZ» of main bar to «constant hfSZrgSZ».
«class hDsZ» of main bar

on this line:

set «class hDsZ» to «constant hfSZrgSZ» --> default is small

Any ideas on how to fix it?

Is there a better progress bar that will show a popup window when running a script from SD or FastScripts?

For reference, here’s the entire script:

(note the script says ver “1.6”, but it IS the demo file from Ver 1.8 download.)

property currentValue : 0.0
property maxValue : 10.0

set iconPath to (path to applications folder as text) & "iTunes.app:Contents:Resources:iTunes.icns"

tell application "SKProgressBar"
  activate
  
  ---------------------------------------------------
  --  SETUP WINDOW THAT CONTAINS ALL PROGRESS BARS --
  ---------------------------------------------------
  set title to "Demo of SKProgressBar 1.6" --> default is "SKProgressBar"
  
  set floating to false --> default is true
  set position to {100, 100} --> default is {1000, 750}, origin point is bottom left
  set width to 400.0 --> default is 500.0
  
  ---------------------------------------------------
  --  SETUP MAIN PROGRESS BAR --
  -- (progress bar 1 by definition)
  ---------------------------------------------------
  --  It already exists, so no need to create
  
  tell main bar --main bar
    
    set minimum value to 0.0 --> default is 0.0
    set maximum value to maxValue -->  default is 100.0
    set current value to currentValue --> default is 0.0
    
    -- header / footer properties
    set header to "MAIN Progress Bar" --> default is empty string
    set header alignment to center --> default is left
    set «class hDsZ» to «constant hfSZrgSZ» --> default is small
    set footer to "footer" --> default is empty string
    set footer alignment to center -->  default is left
    set «class fTsZ» to «constant hfSZmiSZ» --> default is small
    
    -- image path can be HFS or POSIX path, default is missing value (no image)
    set image path to iconPath
    
  end tell
  
  ---------------------------------------------------
  --  CREATE & SETUP PROGRESS BAR #2 --
  ---------------------------------------------------
  
  set progressBar2 to make new progress bar at after progress bar 1 with properties {header:"TEST Progress Bar #2", header alignment:center}
  tell progressBar2
    set maximum value to maxValue
    set current value to currentValue
  end tell
  
  
  ---------------------------------------------------
  --  DISPLAY/ACTIVATE THE PROGRESS BARS --
  ---------------------------------------------------
  --  This will show one window will all progress bars
  
  set show window to true --> default is false
  
  tell main bar
    set indeterminate to false
    start animation
  end tell
  
  repeat 10 times
    my resetMainBar()
    tell progressBar2
      if current value is 1.0 then
        set indeterminate to false
        start animation
      end if
    end tell
    repeat 10 times
      tell main bar to increment by 1
      delay 1
    end repeat
    tell progressBar2 to increment by 1
  end repeat
  tell main bar to stop animation
  tell progressBar2 to stop animation
  
  quit -- This quits the SKProgressBar app, closing all Progress Bars
  
end tell

on resetMainBar()
  tell application "SKProgressBar"
    tell main bar
      set maximum value to maxValue
      set current value to currentValue
    end tell
  end tell
end resetMainBar

I don’t know the answer, but here’s a trouble-shooting suggestion.

When you see raw codes like that, it’s a good place to start.

Open SKProgressBar’s dictionary in Script Debugger and choose View -> Show Raw (Chevron) Syntax. Do a search for hDsZ and/or any of the other codes, and see what they stand for. Try editing the code to use the terminology rather than the codes.

Thanks, Shane. That worked.

Revised/Fixed Code

  tell main bar --main bar
    
    set minimum value to 0.0 --> default is 0.0
    set maximum value to maxValue -->  default is 100.0
    set current value to currentValue --> default is 0.0
    
    -- header / footer properties
    set header to "MAIN Progress Bar" --> default is empty string
    set header alignment to center --> default is left
    --set «class hDsZ» to «constant hfSZrgSZ» --> default is small
    set header size to regular --> default is small          ### FIXED
    set footer to "footer" --> default is empty string
    set footer alignment to center -->  default is left 
    set footer size to regular --> default is small           ### FIXED
    
    -- image path can be HFS or POSIX path, default is missing value (no image)
    set image path to iconPath
    
  end tell

Any idea what caused the original problem?
BTW, the normal method of using CMD-D on the app tell block to open the Dictionary did NOT work. I had to drag/drop the SKProgressBar.app into SD.

Could you have an older version on your Mac somewhere?

Thanks for asking. Yes I did, on an external drive I use for archives.

After I deleted the old versions, and emptied the trash, the original script now works find, no longer showing the raw codes.

But, SD7 still can’t open the Dictionary using CMD-D, even though it shows in the “Running” apps list.

Opens OK if I double-click it there.

Try clearing the cache under Preferences -> Dictionary, move SKProgressBar into /Applications, and relaunch Script Debugger.