Jump to content

TomBenz

Member
  • Posts

    299
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by TomBenz

  1. Is anybody using this workflow on macOS Ventura or Sonoma? This has useful functionality so would like to request and see if one of expert workflow developers can take up update and maintenance of this. @vitor @deanishe @giovanni
  2. See if this is helpful. I just created workflow to add new contact from selected phone text and using universal text action. 1. Two blocks in workflow as below 2. Applescript code used on run argv set selectedText to item 1 of argv -- Get the selected text (assuming it contains a phone number) -- Prompt for first name, last name, and company display dialog "Please enter Contact’s First Name:" default answer "First Name" set ClientName to text returned of result display dialog "Please Enter Contact’s Last Name:" default answer "Last Name" set LastClientName to text returned of result display dialog "Please enter Contact’s Company:" default answer "Company Name" set companyName to text returned of result -- Create a new contact with the provided information tell application "Contacts" set thePerson to make new person with properties {first name:ClientName, last name:LastClientName} tell thePerson set organization to companyName end tell -- Add the selected text (phone number) as a phone number for the contact make new phone at end of phones of thePerson with properties {label:"mobile", value:selectedText} -- Save the changes save end tell end run
  3. Thanks for your reply. It will be great to understand this better. I thought AppleScript can be used to get list of all active applications easily. For example, code like this: tell application "System Events" to ¬ set appBundleIdentifierList to ¬ the bundle identifier of ¬ (every process whose visible is true) repeat with appBundleIdentifier in appBundleIdentifierList try tell application id appBundleIdentifier to ¬ set {appName, winCount} to {name, (count windows)} log appName & ": " & winCount on error errorMessage log errorMessage end try end repeat
  4. @vitor thanks for this workflow. would like to find out if an additional keyword / option can be added to find all open apps on different spaces as well as full screen? It is similar to command+tab but with name search capability.
  5. I have tried this and it works good for one word. Is it possible to run this on a large word document and get a list of misspelled words and suggestions for correction (perhaps one best suggestions). The desired format would be : "assme", "assume" "refning", "refining" This list can be reviewed and then used in find and replace. would welcome any other suggestions / ideas to achieve the same if this is beyond the purpose of above workflow
  6. using macOS Ventura 13.2 -- will check more at my end also.
  7. This is a good idea. I tried this but getting error on line 68 of grabTabs() [14:44:49.168] tabGrab[Script Filter] Queuing argument 'Test' [14:44:49.259] tabGrab[Script Filter] Script with argv 'Test' finished [14:44:49.264] tabGrab[Script Filter] {"items": [{"title": "press \u21a9\ufe0f to save 'Test' as a new set...", "subtitle": "", "valid": true, "icon": {}, "arg": "Test"}]} [14:44:51.279] tabGrab[Script Filter] Processing complete [14:44:51.286] tabGrab[Script Filter] Passing output 'Test' to Script Filter [14:44:51.849] tabGrab[Script Filter] Queuing argument 'Test' [14:44:52.058] tabGrab[Script Filter] Script with argv 'Test' finished [14:44:52.064] ERROR: tabGrab[Script Filter] Code 1: 205:209: execution error: Finder got an error: The operation can’t be completed. (-8072) Traceback (most recent call last): File "/Users/xxx/Downloads/Alfred.alfredpreferences/workflows/user.workflow.1E3E1948-D868-4CAD-A9B9-01AC161E0607/grabTabs.py", line 68, in <module> mySET = grabTabs() ^^^^^^^^^^ File "/Users/xxx/Downloads/Alfred.alfredpreferences/workflows/user.workflow.1E3E1948-D868-4CAD-A9B9-01AC161E0607/grabTabs.py", line 42, in grabTabs output = check_output(command).decode('utf-8').strip() ^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 466, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['osascript', '-e', '\n set windowPaths to {}\n\n tell application "Finder"\n set allWindows to every window\n repeat with aWindow in allWindows\n set folderPath to POSIX path of (target of aWindow as text)\n set end of windowPaths to folderPath\n end repeat\n end tell\n set AppleScript\'s text item delimiters to ":::"\n set windowPaths to windowPaths as text\n set AppleScript\'s text item delimiters to ""\n \n\n return windowPaths\n\n ']' returned non-zero exit status 1.
  8. Thanks @Acidham as it is significant data that I am backing, I would like to re-confirm that it is doing one-way mirroring from source to destination and not doing any two-way sync. I will delete "OneDrive" config and create a new one while you using the earlier created destination folder "OD".
  9. @Acidham I have used this workflow to backup my Onedrive content on iCloud, and it worked great. Many thanks. iCloud doesn't allow folder named "OneDrive" so that I had to change it to "OD" for uploading. Now I want to change destination in rsync for incremental backup but don't want to add again and do full backup. How can I change destination folder from "OneDrive" to "OD" safely in rsync config or Json file?
  10. This was easy. I used ~ in the Environment variable - Doc_Path.
  11. @gohoyer Thanks for this workflow. How do you access shortcuts list directly? Pls see if you can add additional keyword or option to go directly to Shortcut list instead of additional click to select "List shortcuts". I tried this below but one has to press "enter" after rtd to get the options.
  12. is @deanishe still active on forum? If yes, I want to convey many thanks for some wonderful workflows. Appscripts is simply one of the best!
  13. I renamed iMac name to remove special character. It is working good with this change.
  14. Works good for iPad. thanks. Getting error for iMac -- let me know tweak to screen mirror to iMac. @jacobwtyler
  15. thank you @Stephen_C. I had used this app once before and will try again. Will this be able to move all windows in one go? I also use Rectangle (moved to this from Spectacle) but find windows management workflow via Alfred itself easy to use and update.
  16. would be great if somebody can guide / help or write a workflow for it.
  17. Thanks @vitor for your response. Is it possible to move all windows without exception then? I can then manually move teams windows back to main window? https://stackoverflow.com/questions/20554602/applescript-get-list-of-windows-on-all-desktops/67338053#67338053 I see this AppleScript to get list of windows -- How can this combined with move automation task or modified to achieve this/
  18. Hope @vitor or other experts will get to answer mine as well as your question.
  19. You can use Automation tasks to create a workflow for this. Steps are keyword or shortcut to trigger --> key combo (ctrl + command + F) to move the window out of full screen mode, move to next monitor and again make the app full screen.
  20. @vitor How do I use automation task to get and move all windows from one monitor to other? When I am sharing screen on teams, I would like only teams app windows to remain on primary montior (retina display) and move everything else on other monitor. Suggest how this can be done. Thanks in advance
  21. appscripts [<query>] — Show workflow configuration. Help – Open this file in your browser. (No) Update Available — Whether or not the workflow can be updated. Action the item to update or force an update check. Search Directories Recursively – Whether the script directories should be searched recursively. Use with some caution. Edit Script Directories — Open the configuration file in your default editor. The file contains a detailed description of how it works. Reset to Defaults — Delete configuration and cache files. Wow. The recursive search option existed as configuration option and works well. Very happy to discover this! I also tried find ~/Library/Scripts/Applications -type d to get list of folders to add but not sure if the right syntax is ~/Library/Scripts/Applications/Microsoft Word/Archive/ or ~/Library/Scripts/Applications/Microsoft Word/Archive
  22. @vitor -- request for help to include sub-folder. The Python code is too long for me to understand and modify it correctly. Here is the chatGPT three suggestions that I tried but couldn't make it work To modify the code so that scripts stored in sub-folders are also included, you need to make changes in the _get_scripts_for_app method. Here are the modifications you can make: Replace the line: pythonCopy code log.debug('loading scripts from `%s`...', scriptdir) with: pythonCopy code log.debug('recursively loading scripts from `%s`...', scriptdir) Replace the line: pythonCopy code for filename in os.listdir(scriptdir): with: pythonCopy code for root, _, filenames in os.walk(scriptdir): for filename in filenames: Replace the line: pythonCopy code path = os.path.join(scriptdir, filename) with: pythonCopy code path = os.path.join(root, filename) By making these modifications, the code will recursively traverse the script directory and include scripts from all sub-folders as well.
  23. Try with AppleScript for MS outlook below on run argv set subjecttxt to "Test message" -- item 1 of argv tell application "Microsoft Outlook" set theMessage to make new outgoing message with properties {subject:subjecttxt, plain text content:""} make new recipient with properties {email address:{address:"youremail@domain.com", name:"FName and LName"}} at end of to recipients of theMessage open theMessage -- for further editing -- send theMessage -- not sure of this if this can be bad to work end tell end run
×
×
  • Create New...