raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.45k stars 3.15k forks source link

Doesn't re-ask for permissions when allowing the modifications accidentally skipped #13146

Closed pavzagor closed 5 months ago

pavzagor commented 5 months ago

Extension

https://www.raycast.com/HelloImSteven/sips

Raycast Version

1.77.1

macOS Version

14.5 (23F79)

Description

Error:

Error: Command failed with exit code 1: osascript -e set imageTypes to {"PNG", "JPG", "JPEG", "TIF", "HEIF", "GIF", "ICO", "ICNS", "ASTC", "BMP", "DDS", "EXR", "JP2", "KTX", "Portable Bitmap", "Adobe Photoshop", "PVR", "TGA", "WebP", "SVG", "PDF", "HEIC"}

    tell application "Finder"
      set theSelection to selection

      if theSelection is {} and (count Finder windows) > 0 then
        repeat with i from 1 to (count Finder windows)
          activate window i
          set theSelection to selection

          set selectionKinds to {}
          repeat with j from 1 to (count theSelection)
            set selectionKinds to selectionKinds & kind of (item j of theSelection)
          end repeat

          set containsImage to false
          repeat with imageType in imageTypes
            if selectionKinds contains imageType then
              set containsImage to true
              exit repeat
            end if
          end repeat
        end repeat
      end if

      if theSelection is {} then
        return
      else if (theSelection count) is equal to 1 then
        repeat with imageType in imageTypes
          if (kind of the first item of theSelection) contains imageType then
            return the POSIX path of (theSelection as alias)
            exit repeat
          end if
        end repeat
      else
        set thePaths to {}
        repeat with i from 1 to (theSelection count)
          repeat with imageType in imageTypes
            if (kind of (item i of theSelection)) contains imageType then
              copy (POSIX path of (item i of theSelection as alias)) to end of thePaths
              exit repeat
            end if
          end repeat
        end repeat
        return thePaths
      end if
    end tell 
264:273: execution error: Not authorised to send Apple events to Finder. (-1743)

    tell application "Finder"
      set theSelection to selection

Steps To Reproduce

  1. Try modifying the image.
  2. Close the permissions request window.
  3. Get the error that's not fixed even by reinstalling the extention.

Current Behaviour

Doesn't ask for the permissions again if they weren't given.

Expected Behaviour

Asks for the permissions again if they weren't given.

raycastbot commented 5 months ago

Thank you for opening this issue!

🔔 @SKaplanOfficial @arronhunt @nakaakist @JUSTIVE @patomos you might want to have a look.

💡 Author and Contributors commands The author and contributors of `HelloImSteven/sips` can trigger bot actions by commenting: - `@raycastbot close this issue` Closes the issue. - `@raycastbot rename this issue to "Awesome new title"` Renames the issue. - `@raycastbot reopen this issue` Reopens the issue. - `@raycastbot assign me` Assigns yourself to the issue. - `@raycastbot good first issue` Adds the "Good first issue" label to the issue. - `@raycastbot keep this issue open` Make sure the issue won't go stale and will be kept open by the bot.