Jump to content

iApple

Member
  • Posts

    73
  • Joined

  • Last visited

Posts posted by iApple

  1. Hi

     

    Updated OS to Ventura, now RPN workflow doesn't work. I have installed Python 3 so that could be reason?

     

    My technical skill is 2 out of 100, playing around with settings trying to make it work.

     

    Error message each run of RPN workflow

    ERROR: RPN Calculator[Script Filter] Code 127: /bin/bash: python: command not found

     

    Changed "language" to /usr/bin/python3 but getting this error

    ERROR: RPN Calculator[Script Filter] Code 1: xcode-select: note: No developer tools were found, requesting install.
    If developer tools are located at a non-default location on disk, use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, and cancel the installation dialog.
    See `man xcode-select` for more details.

     

    Do I need to install developer tools? Where do I download if it is required? Don't want to end up mindlessly installing if not required.

     

    Thanks

  2. 2 minutes ago, giovanni said:

    there's a plus before 2. 

    Tail command also comes with an ‘+’ option which is not present in the head command. With this option tail command prints the data starting from specified line number of the file instead of end. For command: tail +n file_name, data will start printing from line number ‘n’ till the end of the file specified.

    Thanks! Explanation helps. 

  3. 44 minutes ago, giovanni said:

    you could add a 'Run Script' object with this command (in bash/zsh):

    pbpaste | tail -n +2 | pbcopy

    Thanks for suggesting. Googled command line and that's display last 2 lines, but number of lines in clipboard varies all the time. Is there a way to just to delete the 1st line or pipe all lines expect first line to pbcopy? Only found "wc -l" but that looks to be cumbersome solution.

  4. Hi. Looking for a simple workflow to stripe off first line of text in clipboard, replaces string "These are the value" with "" (blank). How do I remove newline as well in 1st line? Effecting deleting entire 1st line? Tried "These are the value\n" but didn't work. 

     

    Example of text in clipboard

       These are the value

       ABC

       DEF

       GHI

     

    image.jpeg.f266efa6db5c758c3ddde319200219b0.jpeg

  5. On 2/5/2022 at 10:04 PM, vitor said:

    Place the https://www.example_web.com/date_search&begin={date -1D:dd-mm-yyyy}&end={date:dd-mm-yyyy} in an Argument and Variables Utility and connect that to the Open URL using {query} as the URL.

    Thanks Vitor! Good options to have ability to use query and vars as input. Thanks for pointing to Arg and Var Utility.

  6. Hi. Tried a few combination but not successful. How can I include a snippet (today & yesterday's date) in a URL in workflow?

     

    URL example: https://www.example_web.com/date_search&begin={date -1D:dd-mm-yyyy}&end={date:dd-mm-yyyy}

     

    Have both {date -1D:dd-mm-yyyy} and {date:dd-mm-yyyy} in snippet and they work but won't get triggered in open URL. Thanks

  7. 14 hours ago, deanishe said:

     

    In Python 3:

     

    from datetime import datetime, timedelta
    
    # date to find week for in format YYYY-MM-DD
    input_date = '2022-01-06'
    
    dt = datetime.strptime(input_date, '%Y-%m-%d')
    while dt.weekday():  # 0 = Monday
        dt -= timedelta(days=1)
    
    formatted = 'week of ' + dt.strftime('%d %B').lstrip('0')
    
    print(f'{input_date} -> week of {formatted}')

     

    Thanks! Had to google python, took a long while just to learn basics of AppleScript. I’m really a technically challenged individual 😅

  8. 14 minutes ago, deanishe said:

     

    I think there's only "week of year". If you want to find the first day of that week, you'll need to do that programmatically by the looks of it. It probably wouldn't work for you, anyway, because ISO weeks start on a Monday, so next week would be "week of 3 January", not 2.

    Actually Monday start works for me. Was using Sunday as an example ;)

     

    I need to google for a programmatic solution. Was hoping there's a start of week in Andrew's link.

  9. Unless I misunderstood what you meant, it is relative to Safari window because I only invoke this workflow when in Safari and visiting a specific website. Needed routine because website doesn't have keyboard shortcut and sometimes I use different size monitors. Very expensive monthly subscription site yet they don't have keyboard shortcut 😡Need to view different data and much easier to stick to keyboard rather than using mouse to click each time different sets of data are required. KM or BTT probably would be better but don't want to add yet another app and diving into another rabbit hole. Glad Alfred covers so many scenarios & automation.

  10. For those interested in finding resolution of external monitor - found answer and it works. But read that system_profiler could be heavy of CPU usage - not sure how true - I don't have any issue.

     

    set resolutions to {}
    repeat with p in paragraphs of ¬
      (do shell script "system_profiler SPDisplaysDataType | awk '/Resolution:/{ printf \"%s %s\\n\", $2, $4 }'")
      set resolutions to resolutions & {{word 1 of p as number, word 2 of p as number}}
    end repeat

  11. Really bad in programming. Managed to write a simple script to click mouse at certain location. Works on Macbook until I attached to a 27" external monitor which has resolution of 2560*1440. How do I check for resolution of main display or at least check width of display, and mouse click different location if resolution is 2560*1440? Thanks

     

    Current script works on Macbook's inbuilt display.
     

      tell application "Safari" to activate 

      tell application "System Events" 
          tell process "Safari" 
              click at {1421, 515} 
         end tell 
      end tell

  12. Hi. I know Keyboard Maestro has a feature that user can specify a small image/button and KM will look for that image/button on current website & do a mouse click on it. Can this be done with Alfred? There's website [paid website thus no point showing link as non-subscribers can't access website & data] which doesn't have keyboard shortcuts. Hassle to move mouse to click on buttons to change data views and would like to use Alfred to click on those buttons instead. Thank you.

×
×
  • Create New...