Jump to content

noahm

Member
  • Posts

    20
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by noahm

  1. Hi,

     

    I formally do not know any AppleScript, just picked up what I can from various sources, so I may be doing something incorrect.

     

     

    —————

     

     

    My setup:

     

    HotkeyRun Script (below) → Open URL (below)

     

    Run Script:

    tell application "Music"
    	get artist of current track & "-" & name of current track
    end tell

     

    Language: AppleScript, with input as argv running instances Sequentially

     

    Open URL:

    URL: https://genius.com/{query}-lyrics

    Encode spaces as -

     

     

    —————

     

     

    My result:

    https://genius.com/ArtistName-SongName%0A-lyrics

     

    Expected result:

    https://genius.com/ArtistName-SongName-lyrics

     

    "%0A" is a line break in HTML, therefore the desired result does not load as intended.

     

    Doing the script in Script Editor, the result is shown as expected (with no line break at the end).

     

    Thanks for your time.

     

    macOS 13.2 (22D49)

    Alfred 5.0.6 [2110]

  2. % mdls /System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app
    
    _kMDItemDisplayNameWithExtensions  = "Safari.app"
    kMDItemAlternateNames              = (
        "\U1109\U1161\U1111\U1161\U1105\U1175",
        "Safari.app"
    )
    kMDItemAppStoreCategory            = "Productivity"
    kMDItemAppStoreCategoryType        = "public.app-category.productivity"
    kMDItemAppStoreIsAppleSigned       = 1
    kMDItemCFBundleIdentifier          = "com.apple.Safari"
    kMDItemContentCreationDate         = 2022-11-29 06:37:08 +0000
    kMDItemContentCreationDate_Ranking = 2022-11-29 00:00:00 +0000
    kMDItemContentModificationDate     = 2022-11-29 06:37:08 +0000
    kMDItemContentType                 = "com.apple.application-bundle"
    kMDItemContentTypeTree             = (
        "com.apple.application-bundle",
        "com.apple.application",
        "public.executable",
        "com.apple.localizable-name-bundle",
        "com.apple.bundle",
        "public.directory",
        "public.item",
        "com.apple.package"
    )
    kMDItemCopyright                   = ""
    kMDItemDateAdded                   = 2022-11-29 06:37:08 +0000
    kMDItemDescription                 = ""
    kMDItemDisplayName                 = "Safari"
    kMDItemDocumentIdentifier          = 0
    kMDItemExecutableArchitectures     = (
        arm64,
        "x86_64"
    )
    kMDItemFSContentChangeDate         = 2022-11-29 06:37:08 +0000
    kMDItemFSCreationDate              = 2022-11-29 06:37:08 +0000
    kMDItemFSCreatorCode               = ""
    kMDItemFSFinderFlags               = 0
    kMDItemFSHasCustomIcon             = (null)
    kMDItemFSInvisible                 = 0
    kMDItemFSIsExtensionHidden         = 1
    kMDItemFSIsStationery              = (null)
    kMDItemFSLabel                     = 0
    kMDItemFSName                      = "Safari.app"
    kMDItemFSNodeCount                 = 1
    kMDItemFSOwnerGroupID              = 0
    kMDItemFSOwnerUserID               = 0
    kMDItemFSSize                      = 15324692
    kMDItemFSTypeCode                  = ""
    kMDItemInterestingDate_Ranking     = 2023-01-15 00:00:00 +0000
    kMDItemKeywords                    = ""
    kMDItemKind                        = "Application"
    kMDItemLastUsedDate                = 2023-01-15 15:15:57 +0000
    kMDItemLastUsedDate_Ranking        = 2023-01-15 00:00:00 +0000
    kMDItemLogicalSize                 = 15324692
    kMDItemPhysicalSize                = 15130624
    kMDItemUseCount                    = 270
    kMDItemUsedDates                   = (
        "2022-12-15 13:00:00 +0000",
        "2022-12-16 13:00:00 +0000",
        "2022-12-17 13:00:00 +0000",
        "2022-12-18 13:00:00 +0000",
        "2022-12-19 13:00:00 +0000",
        "2022-12-20 13:00:00 +0000",
        "2022-12-21 13:00:00 +0000",
        "2022-12-22 13:00:00 +0000",
        "2022-12-26 13:00:00 +0000",
        "2022-12-27 13:00:00 +0000",
        "2022-12-28 13:00:00 +0000",
        "2022-12-29 13:00:00 +0000",
        "2023-01-05 13:00:00 +0000",
        "2023-01-08 13:00:00 +0000",
        "2023-01-09 13:00:00 +0000",
        "2023-01-10 13:00:00 +0000",
        "2023-01-11 13:00:00 +0000",
        "2023-01-12 13:00:00 +0000",
        "2023-01-13 13:00:00 +0000",
        "2023-01-15 13:00:00 +0000"
    )
    kMDItemVersion                     = "16.2"

     

  3.  

    @Andrew And mine looks pretty much the same, besides the "kMDItemUsedDates" for obvious reasons.

     

    _kMDItemDisplayNameWithExtensions  = "Safari.app"
    kMDItemAlternateNames              = (
        "\U1109\U1161\U1111\U1161\U1105\U1175",
        "Safari.app"
    )
    kMDItemAppStoreCategory            = "Productivity"
    kMDItemAppStoreCategoryType        = "public.app-category.productivity"
    kMDItemAppStoreIsAppleSigned       = 1
    kMDItemCFBundleIdentifier          = "com.apple.Safari"
    kMDItemContentCreationDate         = 2022-11-29 06:37:08 +0000
    kMDItemContentCreationDate_Ranking = 2022-11-29 00:00:00 +0000
    kMDItemContentModificationDate     = 2022-11-29 06:37:08 +0000
    kMDItemContentType                 = "com.apple.application-bundle"
    kMDItemContentTypeTree             = (
        "com.apple.application-bundle",
        "com.apple.application",
        "public.executable",
        "com.apple.localizable-name-bundle",
        "com.apple.bundle",
        "public.directory",
        "public.item",
        "com.apple.package"
    )
    kMDItemCopyright                   = ""
    kMDItemDateAdded                   = 2022-11-29 06:37:08 +0000
    kMDItemDescription                 = ""
    kMDItemDisplayName                 = "Safari"
    kMDItemDocumentIdentifier          = 0
    kMDItemExecutableArchitectures     = (
        arm64,
        "x86_64"
    )
    kMDItemFSContentChangeDate         = 2022-11-29 06:37:08 +0000
    kMDItemFSCreationDate              = 2022-11-29 06:37:08 +0000
    kMDItemFSCreatorCode               = ""
    kMDItemFSFinderFlags               = 0
    kMDItemFSHasCustomIcon             = (null)
    kMDItemFSInvisible                 = 0
    kMDItemFSIsExtensionHidden         = 1
    kMDItemFSIsStationery              = (null)
    kMDItemFSLabel                     = 0
    kMDItemFSName                      = "Safari.app"
    kMDItemFSNodeCount                 = 1
    kMDItemFSOwnerGroupID              = 0
    kMDItemFSOwnerUserID               = 0
    kMDItemFSSize                      = 15324692
    kMDItemFSTypeCode                  = ""
    kMDItemInterestingDate_Ranking     = 2023-01-15 00:00:00 +0000
    kMDItemKeywords                    = ""
    kMDItemKind                        = "Application"
    kMDItemLastUsedDate                = 2023-01-15 15:15:57 +0000
    kMDItemLastUsedDate_Ranking        = 2023-01-15 00:00:00 +0000
    kMDItemLogicalSize                 = 15324692
    kMDItemPhysicalSize                = 15130624
    kMDItemUseCount                    = 270
    kMDItemUsedDates                   = (
        "2022-12-15 13:00:00 +0000",
        "2022-12-16 13:00:00 +0000",
        "2022-12-17 13:00:00 +0000",
        "2022-12-18 13:00:00 +0000",
        "2022-12-19 13:00:00 +0000",
        "2022-12-20 13:00:00 +0000",
        "2022-12-21 13:00:00 +0000",
        "2022-12-22 13:00:00 +0000",
        "2022-12-26 13:00:00 +0000",
        "2022-12-27 13:00:00 +0000",
        "2022-12-28 13:00:00 +0000",
        "2022-12-29 13:00:00 +0000",
        "2023-01-05 13:00:00 +0000",
        "2023-01-08 13:00:00 +0000",
        "2023-01-09 13:00:00 +0000",
        "2023-01-10 13:00:00 +0000",
        "2023-01-11 13:00:00 +0000",
        "2023-01-12 13:00:00 +0000",
        "2023-01-13 13:00:00 +0000",
        "2023-01-15 13:00:00 +0000"
    )
    kMDItemVersion                     = "16.2"

     

  4. Hi again @Vero. I'm really not sure why this bug is occurring. It's still happening and only with Safari. The only thing I can think of is that I used to have Safari Technology Preview installed, and maybe it has affected Safari.app's bundle and may not be seen as an actual application? However, doing Get Info shows the following, which is not out of the usual...

    Screenshot 2023-01-05 at 3.20.23 pm.png

     

    Edit: just noticed it says Friday, 30 December, and the "Last opened" flag does not update when opening it again. I use this every day. Are there any other locations where Safari can be found?

  5. I have a few snippets I use, that are also included at the start of URLs

     

    For example, I have the following Snippets setup:

     

    "macos" converts to "macOS"

    "ios" converts to "iOS"

     

    However, when typing either one of these into Safari, it works as expected, but since deleting once in a Safari URL only removes it's suggestion, and not the character, the first character gets essentially duplicated.

     

    When trying to go to macosicons.com, it becomes mmacOS, and when trying to go to iosbeta.reddit.com, it turns to iiOS.

     

    Alfred is doing the correct behaviour, it's just that Safari is causing the extra headache.

     

    Please see the following screen recording: https://streamable.com/p873ng

     

    My setup:

     

    • macOS 13.1 (22C65)
    • Alfred 5 5.0.6 (2110)
  6. Hello!

     

    I am aware of this page: https://www.alfredapp.com/help/advanced/sync/

     

    What I have done:

    • Set my sync folder to "~/Documents/Alfred/". I do have iCloud Drive enabled but Desktop & Documents folder is disabled (so it's technically not syncing to anything, I just moved the folder location; should I have done this?)
    • Force quit all Alfred processes and reopened (done after the issues came up)

     

    Issues that have occurred:

    • Alfred Hotkey does not work. It was on "⌘Space" before changing the folder. After setting it to the folder (and restarting), the Hotkey was still set, but didn't work. I changed it to something else, and back again, and "⌘Space" does not work. Spotlight is not using this keyboard shortcut either so there are no conflicts.
    • Snippets Auto-Expansion is still checked but does not do anything. Unchecking and re-checking does not change anything.
    • Themes are not recognised when using Alfred (i.e. if I Spotlight for Alfred, then the window opens up, my theme is not applied, despite a theme being selected within Alfred Preferences)
    • How we looks (Appearance → Options) does reflect any of the checkboxes.

     

    I don't really use any of the other stuff mentioned soon the page I linked above, so I cannot confirm if things are the way they should be.

     

    In the meantime, can someone please tell me how to revert what I have done?

    I quit Alfred, removed "Alfred.alfredpreferences" from the folder and opened Alfred again. Then the message came up about preferences not being found, and continued on. Everything went back to normal.

     

    My setup:

    • macOS Big Sur Version 11.5.1 (20G80)
    • Alfred Version 4.5.1 (1256) (20F71)

     

    Thanks for your time.

  7. @jhncbrwn thanks for your help! 

     

    Unfortunately it doesn’t seem to be working for me.

     

    I have the following Workflow setup, and it’s only opening up Safari and doing nothing else ☹️ :

     

    _____

     

     

    1. Keyword (Inputs → Keyword)

     

     

    2. Run NSAppleScript (Actions → Run NSAppleScript):

    tell application "Music"
    	set MySearchtext to (get name of current track) & (" ") & (get artist of current track)
    end tell
    
    set MyURL to "https://example.com/s=" & MySearchtext
    
    return MyURL

     

    3. Open URL (Actions → Open URL)

     

     

    _____

     

    Also worth mentioning I’d rather just have it pass the result to the next action (if possible) rather than opening the URL via the script (i.e. type keyword, get music, pass that result to a “Open URL” action with an already built “Custom Search”)

     

    Thanks!

     

  8. Hello!

     

    Not too sure what I’m doing or how to “pass” a result through to a URL. I have the following code in AppleScript and it’s showing me the appropriate result

     

    tell application "Music"
    	return (get name of current track) & (" ") & (get artist of current track)
    end tell

     

    I now want to pass that (song name and artist name) into a search result I have e.g.

     

    https://example.com/s=SongName%20ArtistName

     

     

    Any help would be greatly appreciated. Thank you.

×
×
  • Create New...