automator

Apple's Automator: compression settings for jpg?

点点圈 提交于 2019-12-20 12:36:24
问题 When I run Apple's Automator to simply cut a bunch of images in their size Automator will also reduce the quality of the files (jpg) and they get blurry. How can I prevent this? Are there settings that I can take control of? Edit: Or are there any other tools that do the same job but without affecting the image quality? 回答1: Automator’s “Crop Images” and “Scale Images” actions have no quality settings – as is often the case with Automator, simplicity trumps configurability. However, there is

New file in same directory as input file . Python

徘徊边缘 提交于 2019-12-20 07:16:50
问题 import sys,os name_list = open(sys.argv[1]).read().split('\r') os.remove(sys.argv[1]) input_file = (sys.argv[2]) def Extractor(input,output='query.txt'): query = open(input,'r').read().split('\r') dir,file=os.path.split(input) temp_out= os.path.join(dir,output) out_file=open(temp_out,'w') print Extractor(input_file) I have no idea why this isn't working . . . i am trying to create a new file in the same directory as the input file but it is saying that there is an error . i'm not used to

Cocoa-Applescript NSOpenPanel?

ぐ巨炮叔叔 提交于 2019-12-19 11:39:07
问题 How do I do an NSOpenPanel in Cocoa-Applescript? Are there any good tutorials? I am familiar with Applescript, but not really the Cocoa part. Do I need a nib for the NSOpenPanel? I am making an Automator action. See my previous question. 回答1: Shane Stanley's PDF book AppleScriptObjC Explored is the one to get for AppleScriptObjC tutorials - pretty much all of the examples from Apple are in the existing ObjC documentation and would need to be converted. There is an Automator path pop-up button

How do I execute a PHP shell script as an Automator action on Mac OS X

落花浮王杯 提交于 2019-12-18 10:57:07
问题 I'm tempted by Automator.app's ability to create contextual services in Mac OS X Snow Leopard. I would like to create some keyboard accessible shortcuts to manipulate text snippets by calling a shell script. However, Automator only suggests bash, Perl, Python and Ruby (among others) to allow this. But, since PHP also ships with Mac OS (and, to be honest, it's the only scripting language I fully master), I wonder why I can't run a PHP shell script. 回答1: This is just a hack, but how about

macOS Mojave, Automator “Not authorized to send Apple events to System Events.”

痞子三分冷 提交于 2019-12-18 10:48:13
问题 After I updated to Mojave, I can no longer use the automator service I've previously been using with the alert below. In Security & Privacy, I already checked AppleScript Editor. Do you see any problem with my code or is this the problem of the newest macOS? Script on run {input, parameters} set pathList to {} repeat with itemNum from 1 to count of input tell application "System Events" copy POSIX path of (container of (item itemNum of input)) to end of pathList end tell end repeat return

Run Shellscript from Mac Automator

為{幸葍}努か 提交于 2019-12-18 07:44:37
问题 In OS X 10.9.5 I wrote a Shell Script (via vim). Save it and navigate to this script and sh code.sh it runs perfect (in iTerm & Total Terminal). The same command in the same directory produces via Mac Automator always an ERROR. Why? in Automator and in Terminal. echo $SHELL /bin/bash Why is it impossible to run a shellscript via Automator. 回答1: This problem can be solved by adding the following code above your current code: export PATH=/usr/local/bin:$PATH 回答2: I suspect it's the cd Desktop

Run Shellscript from Mac Automator

﹥>﹥吖頭↗ 提交于 2019-12-18 07:44:05
问题 In OS X 10.9.5 I wrote a Shell Script (via vim). Save it and navigate to this script and sh code.sh it runs perfect (in iTerm & Total Terminal). The same command in the same directory produces via Mac Automator always an ERROR. Why? in Automator and in Terminal. echo $SHELL /bin/bash Why is it impossible to run a shellscript via Automator. 回答1: This problem can be solved by adding the following code above your current code: export PATH=/usr/local/bin:$PATH 回答2: I suspect it's the cd Desktop

AUTOMATOR - Trying to issue a command inside a shell script with parameters received from AppleScript

笑着哭i 提交于 2019-12-14 03:07:23
问题 I am creating this automator script for macOS that receives videos and extract a frame at a given time in seconds. After receiving the videos from finder, it runs this applescript asking for the time in seconds, to extract the frame. The time is stored into the Applescript variable "seconds". When the applescript ends, I have 3 variables: inputVideo, containing the POSIX input video path outputVideo, containing the POSIX output video path seconds, containing the time in seconds. The

Searching in Finder from Selection

梦想的初衷 提交于 2019-12-13 18:06:48
问题 Usually I get an excel spreadsheet with dozens of filenames, for which I then need to go and search individually. Spreadhseet Is there a way that I could simply: Select All filenames in e.g. row A of Excel, then Search for all these files on "This Mac" then Copy all found files into the New Folder on the Desktop So far I've tried the first part of searching and this is what i get :a) Automator with Variable. But the problem is, it only searches for 1 file from selection b) Automator with

Create an image annotation tool with AppleScript and Automator

拥有回忆 提交于 2019-12-13 16:44:35
问题 On Mac, is it possible to use AppleScript/Automator to show a preview of an image in the background, while the Automator app is running? I have hundreds of images to which I want to add meta data so that they can be displayed on a web site. My plan is to create a *.meta file with the same name as the original image, so that a PHP script can read in the meta data at the same time that it generates the URL for the image. I have created an AppleScript file (see below), which I have embedded in