automator

Read a text file with Automator.app line by line

别说谁变了你拦得住时间么 提交于 2019-12-01 08:20:49
问题 I'm a novice at coding so please be patient with me. I've created a Workflow with Automator (OSX) which works fine. The only issue I have is that I want it to run on a number of inputs (that is as a batch). I've inserted the Loop action but the problem I'm having is about changing the initial input each time. I would like to use an applescript to automate the insertion of the initial input each time. I have a TXT file with URLs. With an apple script, I'd like to copy a URL (or a line of text)

Automator / AppleScript to process incoming emails in Mac Mail

亡梦爱人 提交于 2019-12-01 07:09:14
问题 I'm designing an app that allows users to email me crash reports if my app ever crashes. I'd like to leave Mac Mail running on a computer and when an email comes through, an automator script / AppleScript runs to process the contents of the body of the email. I've got the entire parsing/processing done in a python script, except I have to manually copy the contents of the email into a file and then run my parser on that file. What's the best way to set this up so I can the contents of the

Mac OS X - Passing pathname with spaces as arguments to bashscript and then issue open Terminal command

Deadly 提交于 2019-12-01 00:52:53
Problem Using bash shell on Mac OS X Mavericks I created a bash script called test.sh that accepts one command line argument:- $ cat test.sh #!/bin/bash open -a Terminal $1 When i execute this script in the following way:- $ ./test.sh /Users/myusername/Desktop/folderwithoutspaces/ it executes perfectly and launches a new Terminal window in the given folder. But when i execute this script in the following way:- $ ./test.sh /Users/myusername/Desktop/folder\ withspaces/ it fails to open a new Terminal window and shows the following error message:- The files /Users/myusername/Desktop/folder and

Mac OS X - Passing pathname with spaces as arguments to bashscript and then issue open Terminal command

霸气de小男生 提交于 2019-11-30 19:55:54
问题 Problem Using bash shell on Mac OS X Mavericks I created a bash script called test.sh that accepts one command line argument:- $ cat test.sh #!/bin/bash open -a Terminal $1 When i execute this script in the following way:- $ ./test.sh /Users/myusername/Desktop/folderwithoutspaces/ it executes perfectly and launches a new Terminal window in the given folder. But when i execute this script in the following way:- $ ./test.sh /Users/myusername/Desktop/folder\ withspaces/ it fails to open a new

Applescript to open terminal, run command, and show - Not working

寵の児 提交于 2019-11-30 09:55:41
I´m trying to create a keyshortcut to open terminal in current folder. Looking around, I found this code to create a service (the part of adding the shortcut to this service is solved), only added things are the "; clear" and some of the "activate" so it shows on run {input, parameters} tell application "Finder" activate set myWin to window 1 set theWin to (quoted form of POSIX path of (target of myWin as alias)) tell application "Terminal" activate tell window 1 activate do script "cd " & theWin & ";clear" end tell end tell end tell return input end run It is not working as i would like.

Mac Automator - Combine PDF files, save in same folder

余生长醉 提交于 2019-11-30 07:44:29
I'm using Automator to combine PDF files, but can't figure out how to automate saving the resulting file to the same folder. (Instead, it asks me where to put the file.) I'm using it as a service - here's my existing workflow: 1) Service receives selected -PDF files- in -any application- 2) Combine PDF Pages [appending pages] 3) Rename Finder Items: Name Single Item [Name Single Item, Basename only, to "TestResults"] 4) Move Finder Items [to a folder - show action when workflow runs] Ideally, I'd love the resulting file: -- to be named based on (the folder where it's located) + (an appended

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

邮差的信 提交于 2019-11-30 01:26:01
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 pathList end run This is definitely a part of Mojave's new security framework. In terminal try osascript

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

隐身守侯 提交于 2019-11-30 00:47:12
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. This is just a hack, but how about creating a python, or ruby or perl or bash script that calls php command-line interpreter with the php script you

Adding a script to MacOS finder contextual menu

自古美人都是妖i 提交于 2019-11-29 22:39:53
I want to add an option to the finder context menu that calls hg add %1 with %1 being the full path of the selected file in finder. Of course there are more useful cases I can think of, to add to the context menu. Is there a simple way to do that which doesn't involve installing any 3rd party software or coding in a compiled language and building binary plugins? Like creating a script with the script editor and dropping it in /Library/Contextual Menu Items/ ? Yeah, I know this is third party software - but for the sake of a fuller overview - http://www.abracode.com/free/cmworkshop/on_my

Applescript to open terminal, run command, and show - Not working

狂风中的少年 提交于 2019-11-29 15:03:20
问题 I´m trying to create a keyshortcut to open terminal in current folder. Looking around, I found this code to create a service (the part of adding the shortcut to this service is solved), only added things are the "; clear" and some of the "activate" so it shows on run {input, parameters} tell application "Finder" activate set myWin to window 1 set theWin to (quoted form of POSIX path of (target of myWin as alias)) tell application "Terminal" activate tell window 1 activate do script "cd " &