Jump to content
shape5

Automator workflow/service or Applescript for looped edits in Preview

1 post in this topic

Recommended Posts

Hi all, I was originally trying this with Automator, but if someone can guide me to accomplishing this easier with Applescript then feel free, though i haven't worked with it before.  I am trying to get specific actions within a workflow looped. I just need the workflow to process a single image file continuously so the selected edits repeat within the 1 file until i stop the loop. Here are some basic actions i'm trying to get started with:

1 - get specified finder items
2 - copy finder items
3 - scale images
4 - crop images
5 - loop

The problem is that i want to loop only actions 3 & 4, but the loop starts over at 1 and creates a new file each time it loops. Can i create 2 workflows where the 2nd one (containing actions 3/4/5) starts when the first (containing 1/2) ends so only the 2nd workflow is looped? I'm not sure how to tell the 2nd one to start when the first ends though. Do i just set the input of the 2nd to use the 1st workflow file?

 

or if it's possible to run this as a service from within Preview that's fine too.  Originally i had this setup as WMD (watch me do) actions but Automator won't record the selection tool. if i can get the selection tool recorded then i can keep it as a WMD based workflow.  Acorn (for crop/scale i believe) & Extra Suites (Applescript app for recording the mouse click & draw) were apps i saw mentioned on other posts that came up on google searches which might be able to help accomplish this workflow or script.

Any help would be greatly appreciated.

thanks

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By arsradu
      Hi guys,
       
      So, this little tutorial is meant to help people fix a new issue with Mojave: opening jpg files (looks like it happens with larger files, not so much with smaller ones) using Quick Look (on spacebar key pressed) or Preview app, using the dedicated GPUs.
      The issue is that, when trying to open jpg files (for some reason, it doesn't occur with pngs), the pop-up window would remain in an endless loop. And from that point forward, any other app trying to open the same file will either become unresponsive (in the case of the Preview app) or just stay in endless loop (in case of Quick Look)
       
      As a workaround, in case the tutorial below doesn't work for you, you can use Grab (built-in app in MacOS) to open said files.
       
      This issue DOES NOT occur using the iGPU. So...if you're comfortable using the iGPU, just switch to that and you should be good to go. You don't need this tutorial.
       
      This tutorial is based on @Cyberdevs' research and testing on this topic (especially useful if you're using an RX series AMD video card), and my own very limited time testing this on my rig. I just thought it would be useful to create a new thread for it so that people can discuss this particular issue here.

       
      With that being said, I'll just move on to the actual tutorial.
       
      New (probably better) method.
       
      Switch your SMBIOS in Clover config in regards to the dedicated GPU you're using, instead of the CPU. Take a look here and choose the corresponding SMBIOS closest to your hardware.
      Yeah, that's it.
       
      In case you lose CPU PM with this method, there are multiple ways to fix that, and they do not make the object of this thread.  It worked perfectly fine for me though and I didn't need to change anything else.
       
      Alternatively, you can also try one of the MacPro SMBIOSes, such as MacPro5,1 or MacPro6,1. It was tested multiple times and it showed good results. 
      Keep in mind that choosing these will most likely not show you an iGPU in System Report, since those machines generally (probably all of them) use Xeon CPUs with no iGPUs either.
       
      A simple Lilu plugin
       
      Thanks to vulgo for the plugin and @Matgen84 for sharing and testing it, we now have yet another possible solution to this issue. It's a Lilu plugin (which means that it requires Lilu.kext in order to work) it's called NoVPAJpeg, and it can be downloaded from here.
      You use it as a regular kext, alongside Lilu. I prefer (and recommend) using it within the EFI folder, in Clover/kexts/Other. But if you want to use it in S/L/E, that should work just fine.
       
      More info can be found in this post here.
       
      In case you wanna try alternative medicine  ...
       
      The main thing we need to do is actually very simple: we need to enable the iGPU (integrated GPU) by default, in BIOS, while actually being connected to the dedicated GPU.
       
      For ATI GPUs (curtesy of @Cyberdevs' post here).
       
      The discreet GPU should be set as primary in BIOS and your displays should be connected to your discreet GPU
      The iGD/iGPU/iGFX must be enabled in BIOS/UEFI as the secondary GPU.
       
      I removed the DSDT Reconfigured the config.plist to and removed some flags which weren't needed because of the DSDT added the InjectATI + Ornioco Framebuffer (I removed the Orinoco framebuffer because of some weird glitches but it might be useful for other AMD GPUs if you inject the correct framebuffer according to your GPU. No need to inject anything for nVidia GPUs unless your GPU needs it) Added the InjectIntel + ig-platform-id for my intel HD530 (for intel HD 530 I use the 0x19120001 ig-platform-id)  
      Steps 5 to 7 might not be necessary I just did them anyway, if anyone succeeded to get quicklook working without those steps let me know so I can exclude those steps.

           Also confirmed to work with AMD R9 270X on a SandyBridge rig (without an iGPU) using WhateverGreen + Lilu kexts, which also helped to solve the transparency issue along with the Quick Look problem, it also resolved the buggy Screen Capture (Command+Shift+5) issue as well. 
       
          Also, do:
      nvram cleanup kextcache & prelinked kernel rebuild reboot  More info on that here.
       
       
      For NVIDIA GPUs
       
      This is what I needed for my NVIDIA rig and the MSI motherboard in the signature. Your milage may vary, depending on your hardware. But, the idea should be the same regardless.
       
         For MSi motherboads (check out my motherboard details in the signature)
       
      Set your BIOS to use PEG (dedicated GPU) so you can boot.
      Since you're reading this, chances are that you're already connected to the dedicated GPU and the BIOS is set to PEG. So just go into BIOS and see if you're using the iGPU or the dedicated (PEG) graphics device by default.
      If you're already using this, skip to Step 3 (the part AFTER Reboot). Reboot (I think you don't necessarily need to boot into the OS...but you do need to reboot at least until Clover UI) Reboot back into BIOS and set it from PEG to IGD (integrated graphics) WITHOUT removing the cable. Save Reboot again.  
         The result should be that the OS is tricked into thinking you're booting with the IGPU when in fact you're using the dedicated GPU.
       
         For Gigabyte motherboards
       
         Set:
      Peripherals -> Initial Display Output -> iGFX Chipset -> Internal Graphics -> Enabled
           DVMT Pre-Allocation -> default 64M.
           DVMT Total Gfx Mem -> default 256M Save Reboot  
         You should do this with the cable connected to the dedicated GPU.
       
      You will also need to patch the iGPU from Clover config.
      1. Graphics -> Inject Intel (UNCHECK Inject Nvidia or ATI if it's checked).
      2. ig-platform-id (in my case for Intel HD 4600 Desktop) it was: 0x0d220003
       
      And use IntelGraphicsFixup.kext (now included into WhateverGreen.kext) in Clover/kexts/Other. In my particular case, without the kext, I would get freezes in Safari.
       
      Another way to activate the iGPU while having the dGPU set as primary is by going into BIOS/SAG/Graphics Configuration/iGPU and setting Multi-Monitor to [Enabled], all the rest remains on [Auto], and set Inject/Intel to [True] in Clover config.*.
       
      Thanks to @gjw for the tip.
       
      *Motherboard dependent. But the multi-monitor option might be the same regardless of manufacturer.
       
       
      This might be a bug with Mojave and it could be fixed by Apple in the future. but in the meantime, feel free to use this if it helps you fix the issue.
       
      For HP motherboards (including laptops), so far no solution, unless the BIOS somehow allows to switch from dGPU to iGPU and vice-versa.
       
      Cheers!
    • By bojarek8
      Hi! 
       
      I'm Kris!  I hope my topic is in a good section.
      I am asking you guys for help in this difficult hackintosh problem. 
      For a very long time I tried to solve it myself but I have no idea how I can solve this problem.
       
       
      Description of the problem
       
       
      My problem is that I do not have access to any apple service. I am unable to log into the App Store using my Apple ID. I am unable to log into iCloud account in system preferences. iMessage and Facetime also do not work.  Messages that I get when I try to log in: "An error occurred during activation. Try again" 
       
      in iMessage: "An error occurred during activation. Try again" 
      in App Store: "This device or computer can not be verified. Contact the support department for help"
      in Face Time: "There was an error during activation. Try again"
       
      In summary, I am unable to log in to any apple network service. 
       
      My Specification 
       
      Motherboard:  Acer MG43M
       
      Processor: Intel(R) Core(TM)2 Duo CPU  E7600  3.06GHz
       
      Graphic card: Gigabyte GeForce 9600GT 515MB 
       
      Wi-fi: TP-LINK  TL-WN881ND
       
      Ethernet: (not supported) 
       
      Audio: (rather, it is not needed here)
       
      Files: 
       
      My config.plist: https://drive.google.com/drive/folders/1vlYJC329sz6yuTwFr-k0fOs3rfhKeI6l
       
       
       
       
       



    • By foolgladly
      Hello, everyone.  Long time listener, first time caller.
       
      Here's what I'm setting out to do:  because I can no longer reliably receive a delivery of the New York Times for my daily crossword obsession, I'm now a subscriber to their digital crossword.  I still prefer to do the puzzle on paper, and fortunately the NYT offers a scale PDF of the puzzle each day.  I'm hoping to write a script (I'm incredibly new to this) to download the file and print it every day so that I can feel like I live in a future where magic robots deliver my crossword puzzle to my printer each morning.
       
      The file naming scheme is simplistic and consistent.  As an example, here's today's PDF location:
       
      https://www.nytimes.com/svc/crosswords/v2/puzzle/print/Nov1017.pdf
       
      Obviously, the only thing changing here daily is the file name.  I'm hoping I can use today's date to scrape the relevant information and generate the correct filename on a daily basis.
       
      From there I assume it should be trivial to download the file to a specific location and automatically send it to the printer.  I've been poking around, and I have some level of confidence that I can pull off the downloading and printing parts.  I don't, however, have any idea how to get started generating the daily file name.
       
      Any assistance you can provide would be hugely helpful.  I know the basic answer is "learn to code, it's really helpful."  I'm willing to put some time and effort in here, but I figured this would be a great place to start.
       
      Thanks in advance, and happy Veteran's Day!
    • By midi-sama
      Hi, I'm back again with another tool. As you may have seen in my thread, there is a Automator + AppleScript (thanks to @thanh) to make the reinstall/fix for UPDD, so I decided to make one application for everything with no hassle, however, since I'm not a programer, I'm just using AppleScript (for its fairly easy use and scripting).
      I want you to help me out to fix (also optimize and clean) this script to make it better.
       
      Here is the script:
      -- Start with a welcome screen + password set pwd to text returned of (display dialog ¬ "Hello there This is an AppleScript utility that will help you fix UPDD. First I need your password to continue working of this:" with title ¬ "UPDD Fix Script" with icon note ¬ default answer ¬ "" buttons {"Nope", "Continue ..."} ¬ default button 2 cancel button 1 ¬ with hidden answer) -- Now show dialog for choice set choice to (display dialog ¬ "Hello there, what do you wanna do?" buttons {"Reinstall UPDD", "Start UPDD with time fix", "Exit"} ¬ with title "What do you want to do?" cancel button 3) -- Choice selection if choice = {button returned:"Reinstall UPDD"} then -- Reinscall UPDD case display dialog ¬ "Are you sure you want to reinstall UPDD?" buttons {"No", "Sure"} ¬ default button 2 cancel button 1 set sure_inst to button returned of result -- Starting the install -- TODO: If Nope is selected, loop back to the dialog of choices if sure_inst = "Sure" then -- Install UPDD -- TODO: Add a "Working..." window WHILE it's installing set install_result to do shell script "installer -pkg /Library/UPDD_*.pkg -target /" password pwd with administrator privileges -- Show Install results + updd fix prompt display dialog install_result with title "Install Results" buttons {"OK, now UPDD fix", "OK, I'm done here"} cancel button 2 default button 1 -- UPDD Fix -- TODO: Same as the previous one tell application "UPDD Gestures" to quit saving no do shell script "/usr/sbin/systemsetup -setusingnetworktime off " password pwd with administrator privileges delay 2 do shell script "/usr/sbin/systemsetup -setdate '04:05:15'" password pwd with administrator privileges delay 2 tell application "UPDD Gestures" activate end tell delay 2 -- ERROR: for some reason, it may give an error. do shell script "/usr/sbin/systemsetup -setdate '10:12:16' " password pwd with administrator privileges delay 2 do shell script "/usr/sbin/systemsetup -setusingnetworktime on " password pwd with administrator privileges display notification "We're done." with title "We're all set." end if -- Done with UPPD Reinstall -- TODO: loop back to the choice menu else if choice = {button returned:"Start UPDD with time fix"} then -- UPDD Fix display dialog ¬ "This will bring back your maching clock back in 2015 then back to the actual internet time, this will momentally break some apps/connections (like synergy and maybe even some websites), make sure there are no active time-sensitive apps running if this can damage it or ruin your work" buttons {"Nope, stop", "OK, continue..."} default button 2 cancel button 1 with title "UPDD Rewind" set reupdd to button returned of result if reupdd = "OK, continue..." then -- TODO: Show a "Working..." window tell application "UPDD Gestures" to quit saving no do shell script "/usr/sbin/systemsetup -setusingnetworktime off " password pwd with administrator privileges delay 2 do shell script "/usr/sbin/systemsetup -setdate '04:05:15'" password pwd with administrator privileges delay 2 tell application "UPDD Gestures" activate end tell delay 2 do shell script "/usr/sbin/systemsetup -setdate '10:12:16' " password pwd with administrator privileges delay 2 do shell script "/usr/sbin/systemsetup -setusingnetworktime on " password pwd with administrator privileges display notification "We're done." with title "We're all set." -- TODO: loop back to the choice menu end if end if display dialog "Thank you for using this utility, please check insanleymac.com for more goodies!" buttons {"Thanks", "Get me to InsanelyMac"} with title "Thank you. We're done here." default button 1 cancel button 1 set done to button returned of result if done = "Get me to InsanelyMac" then open location "http://www.insanelymac.com/forum/" delay 1 end if Thanks for any help and feedback
×