Jump to content

TomBenz

Member
  • Posts

    299
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by TomBenz

  1. Thanks Stephen. I was using "Reveal in Finder". Now destination folder is opening up as I have used {var:newBaseFolder} in Open File action. Selecting moved files at destination would have been ideal but this will be for future
  2. @Stephen_C hi Stephen, this is a great workflow to move files to new folder. I would like to use this as base and see if I can create new workflow that moves selected files to destination (existing or new folder) and then open the new location with moved files selected at this location. Is this feasible? Pls guide
  3. @jdb Request you to look into this issue @vitor https://github.com/johandebeurs/alfred-mstodo-workflow/issues On MacOS Sonoma, I'm getting the following error when trying to setup td worflow. This also happens when running _td-full-reset and _td-reset. Here's my settings from ENV ➜ ~ which -a python3 /opt/homebrew/bin/python3 /usr/bin/python3
  4. Thanks for your reply. Print command doesn't give option to print only selected text in outlook / safari etc. Got this code and Alfred workflow with universal action to achieve my desired outcome. tell application "System Events" keystroke "c" using {command down} end tell tell application "TextEdit" activate set newDoc to make new document tell application "System Events" to keystroke "v" using command down delay 0.2 activate -- Ask the user if they want to print before closing set printResponse to display dialog "Do you want to print the document before closing?" buttons {"Print", "Don't Print"} default button "Print" -- Check the user's response if button returned of printResponse is "Print" then print front document without print dialog end if set saveResponse to display dialog "Do you want to save the document before closing?" buttons {"Save", "Don't Save"} default button "Don't Save" -- Check the user's response if button returned of printResponse is "Save" then set desktopPath to path to desktop folder as text set rtfFileName to "temp_text.rtf" set rtfFilePath to desktopPath & rtfFileName save front document in file rtfFilePath end if -- Close the document without saving it again close window 1 with saving end tell
  5. 1. Is there a workflow that can be used to manually trigger, list all printer, select and change default printer? 2. Is it possible to go further to set it based on office or home wifi network. Request to share your experience on this or guide. I got below from chatGPT: Changing the default printer based on your network location (home or office) can be automated on a macOS system using a combination of AppleScript, shell commands, and Location-aware settings. There isn't a direct built-in feature in macOS to automatically switch printers based on network location, but you can achieve this through a somewhat manual setup using network locations in System Preferences and running scripts when these locations change. Setting Up Network Locations Create Network Locations: Go to Apple Menu > System Preferences > Network. Click the Location drop-down menu at the top and choose Edit Locations. Use the "+" button to add new locations, naming one "Home" and another "Office" or as per your preference. Configure the network settings for each location as needed, such as Wi-Fi network SSID, and then switch between them as you move between your home and office. Script to Change Default Printer You can write an AppleScript or shell script to change the default printer. Here's a simple example of how to do it in AppleScript: applescriptCopy code -- AppleScript to set the default printer set currentLocation to "Home" -- or "Office", you can automate this part by detecting the network SSID if currentLocation is "Home" then set defaultPrinter to "Home_Printer_Name" -- Replace with your home printer's name else if currentLocation is "Office" then set defaultPrinter to "Office_Printer_Name" -- Replace with your office printer's name end if do shell script "lpoptions -d " & defaultPrinter Automating the Process Automating this process involves detecting when your network location changes and then running the appropriate script. This can be more complex, as macOS does not provide a direct way to trigger scripts on network location changes. However, you can use third-party tools or create a custom solution to monitor network changes and trigger the script. Third-Party Automation Tools: Tools like Keyboard Maestro or Hazel can be configured to run scripts based on certain triggers, such as connecting to a specific Wi-Fi network. Custom Solution: Write a daemon or use launchd to periodically check the current Wi-Fi SSID or network location and run the AppleScript to switch the default printer accordingly. This requires a more advanced understanding of macOS scripting and system configuration. Steps for a Custom Solution Write a script that checks the current network SSID using a shell command like networksetup or by parsing system logs. Use launchd to run this script at regular intervals or upon network changes. The script then determines the location (home or office) based on the SSID and runs the appropriate AppleScript to change the default printer. Note This solution requires a bit of setup and possibly learning more about macOS scripting and automation. Depending on your macOS version, some commands or steps might differ, and you may need administrative privileges to change network settings or add launchd tasks. For more detailed instructions or help with scripting, you might consider looking into macOS scripting communities or forums, as well as the official AppleScript and launchd documentation.
  6. @vitor @Vero Is there a universal action that prints selected content in any application to default printer or open in preview?
  7. Has somebody else taken up further development of ChatFred?
  8. This is very good and useful. Thank you for sharing. Is it possible to also navigate to Groups or Smart Folders in similar manner?
  9. Are there user that are using both Alfred and Keyboard Maestro? What are things that can be acomplished via KM over and above Alfred. I find Alfred easier to use and maintain especially with Gallery addition in version 5. Is it worth exploring KM macros? it will be good to get some advice from user that use both and learn few use cases of KM that Alfred can't do easily.
  10. @Acidham is it possible to add a destination folder by navigating to it? I have excluded this location from indexing so search and add don't work. I would like to use universal action to select the source and then navigate to the destination on a non-indexed location on iCloud to add as the destination.
  11. as suggested in Open conference url, I have installed icalBuddy. This has improved the performance. for info.
  12. Is it possible to fix this to work on macOS Sonoma? The alternative workflow Open Conference URL is slower atleast on my machine.
  13. thank you @vitor I could download .vtt file without downloading video with yt-dlp. To download only the .vtt subtitle file without downloading the video itself using yt-dlp, you can use the following command: yt-dlp --write-subs --sub-format "vtt" --skip-download "https://www.youtube.com/watch?v=N45KtLPcRS8" This command tells yt-dlp to: --write-subs: Download subtitles. --sub-format "vtt": Specify the subtitle format as .vtt. --skip-download: Skip downloading the video itself, only download the specified subtitles. Replace "https://www.youtube.com/watch?v=N45KtLPcRS8" with the URL of the YouTube video from which you want to download the subtitles.
  14. Download Media already downloads and embeds subtitles in the downloaded file. -- this works great. It will be great to have an option to download transcripts / captions only without downloading video or audio.
  15. @vitorIs it possible to download Youtube video transcript in vtt or SRT file format? i.e. you tube video transcript download as an added option to YouTube video download?
  16. @Acidham I love this workflow and use it for backup. Request for some info on it: 1. rsync_log lists files getting added or deleted during the sync process. How are these identified? I sometimes get files that have stayed the same during the incremental backups. It will be good to understand this better 2. Is rsync_log storing the last sync time somewhere or does it create a complete rsync list by comparing source and destination fully? How much time should this step typically take for 50/100 GB of data? 3. I am using rsync to do a backup of OneDrive to iCloud. OneDrive files are not always on disk (even after marking it to download all) so build the list takes a long time. Is it the reason for the long time to generate file list? Is anybody using using OneDrive and facing challenges in keeping all files local?
  17. Pls share updated version via Github. Many thanks in advance
  18. https://github.com/zeitlings/alfred-workflows/releases/tag/v1.1.1-ocr In OCR Light, please consider adding universal file action to process OCR image file and copy the content to clipboard. This is similar to one done for PDF.
  19. Many many thanks @zeitlings for your inputs and time on this. I will experiment with highlight.py and revert in few days.
  20. @zeitlings thanks for your help. I'd start with passing (a) the text file location $loc and (b) the keywords, i.e. the query as $1 for zsh argv -- how to do this exactly? Is it possible to post a seperate workflow for it. I have tried but no clear how I can pass $loc and keywords from earlier workflow into my Python code. I get two errors: 1. line 8, in <module> keywords = sys.argv[2] IndexError: list index out of range 2. Upon hardcoding keywords for testing, I get the error I get line 12, in <module> sentences = sent_tokenize(text) NameError: name 'text' is not defined I have only basic understanding of Python so trying to learn and make this work. Thanks in advance for your help.
  21. Ok, thanks @vitor. Yes, this one works good on macOS Sonoma. Not pososible to fix the earlier one?
  22. One of my favorite work is this Video conference. This works good on macOS Ventura but running into calendar access issue on macOS Sonoma. @vitor @deanishe and others -- request for review and resolution of this. 19:21:07 workflow.py:2080 ERROR No Access to Calendars Traceback (most recent call last): File "/Alfred.alfredpreferences/workflows/user.workflow.F2AE98BD-B8F2-45B9-AA0E-FFBC6BEBB921/workflow/workflow.py", line 2073, in run func(self) File "./video-conferences.py", line 240, in main raise RuntimeError(data['error']) RuntimeError: No Access to Calendars 19:21:07 workflow.py:2103 DEBUG ---------- finished in 0.014s ---------- [19:21:07.683] Video Conferences[Script Filter] { "items": [ { "valid": false, "subtitle": "No Access to Calendars", "icon": { "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns" }, "title": "Error in workflow 'Video Conferences'" } ] }
  23. @zeitlings request to consider and add an option to extract key sentences (sentences where key phrases are located). It will be great if the docx file key sentences are not only extracted but also highlighted in yellow i.e extract and highlight key sentences option. See the code below for sample code in Python. You can add such an option or guide how to incorporate this. # Code to highlight keysentences using keyphrases extracted from nlp # import required library # install textract, rake libraries import nltk import textract from rake_nltk import Rake from tkinter import filedialog as fd from docx import Document from docx.enum.text import WD_COLOR_INDEX import tkinter as tk import os.path #nltk.download('stopwords') #nltk.download('punkt') filename = fd.askopenfilename() text = textract.process(filename).decode("utf-8") rake_nltk_var = Rake(min_length=2, max_length=4, include_repeated_phrases=False, stopwords={'yet', 'would', 'words', 'wise', 'whether', 'wherein', 'went', 'you', 'what', 'usage', 'ultimately', 'to', 'there', 'then', 'that', 'still', 'site', 'when', 'we', 'wants', 'vertical', 'vary', 'try', 'through', 'this', 'so', 'something', 'see', 'shift', 'will', 'said', 'require', 'say', 'or', 'now', 'no', 'much', 'move', 'me', 'part', 'post', 'require', 'related', 's', 'value', 're', 'of', 'it', 'is', 'instead', 'initially', 'let', 'in', 'if', 'i', 'only', 'pick', 'yours', 'within', 'which', 'used', 'use', 'tried', 'those', 'the', 'taken', 'take', 'shows', 'however', 'similar', 'types', 'how', 'work', 'with', 'where', 'way', 'wanted', 'uses', 'us', 'towards', 'typical', 'show', 'same', 'requires', 'remember', 'referred', 'read', 'question', 'volume', 'volumes', 'one', 'two', 'thing', 'things', 'some', 'overview', 'over', 'other', 'various', 'them', 'on', 'off', 'of'}) # min_length and max_length to control words size in phrases and include_repeated_phrases to keep or remove repeated phrases based on true and false rake_nltk_var.extract_keywords_from_text(text) keyphrases_extracted = rake_nltk_var.get_ranked_phrases()[:50] # to increase or decrease the no. of key_phrases to be selected, change value in [ ] print("Key_Phrases: ") print(keyphrases_extracted) print("\n") print("No. of Keyphrases extracted are:", str(len(keyphrases_extracted))) from nltk.tokenize import sent_tokenize search_words = keyphrases_extracted matches = [] sentances = sent_tokenize(text) for word in search_words: for sentance in sentances: if word in sentance: matches.append(sentance) print("Extracted key sentences: ") print(matches) print("\n") print("No. of Key sentences extracted are: ", str(len(matches))) doc = Document(filename) for para in doc.paragraphs: for items in matches: start = para.text.find(items) if start > -1: pre = para.text[:start] post= para.text[start+len(items):] para.text = pre para.add_run(items) para.runs[1].font.highlight_color = WD_COLOR_INDEX.YELLOW para.add_run(post) # Save the output in new doc file at selected file location root, extension = os.path.splitext(filename) output_filename = root + "_KeySent_Highlights_C1" + extension doc.save(output_filename)
  24. @giovanni This workflow works very good for outlook search. many thanks. I just wanted to check if it can be enhanced to create new email with selected content in any application / website i.e universal action to create new email in outlook with HTML / RTF format.
×
×
  • Create New...