Re: AppleScript fails in Automator - Permissions error
Re: AppleScript fails in Automator - Permissions error
- Subject: Re: AppleScript fails in Automator - Permissions error
- From: Lists <email@hidden>
- Date: Sun, 07 Jul 2013 10:41:21 -0700
On Jul 7, 2013, at 4:59 AM, Manoah F. Adams < email@hidden> wrote:
Hi,
I've tried your script on a Tiger (OS-X 10.4) system and it works perfectly.
Maybe Apple has in newer versions of the OS/Automator decided to run it (its scripts that is) under a dedicated user and-or group. If so, the Desktop path may not even exist and will certainly not be the one you want any way.
Try running just " display dialog (path to desktop as string) " to make sure your getting the actual path you want.
That correctly returns my path to desktop. You can also check... do shell script "echo $USER" display dialog result
But, this raises a blank dialog box with "OK" and "Cancel" buttons. It does not return my name as AppleScript does.
I guess I'll stick with my work around for now. It may also be my system which hasn't had a clean install since mid 2010 (Snow Leopard).
Thanks to everyone for your help. I'll try this again after I clean install 10.9.1.
J
On Jul 6, 2013, at 13:13 , Lists wrote: The following simple script for naming and saving a currently open TextEdit document works from AppleScript but fails under Automator.
set file_name to "Gotcha " set c_date to (do shell script "date +%Y%m%d_%H.%M.%S") set file_path to (path to desktop as string) & file_name & c_date & ".rtfd" tell application "TextEdit" close document 1 saving in file file_path end tell
Is it possible to do this with Automator? I have a work around, but it is so ugly I'm embarrassed to reveal it. The last step of the Automator workflow sends a keystroke command via AppleScript to FastScripts which performs the save :-\ delay 2 tell application "Finder" to activate tell application "System Events" tell application process "Finder" keystroke "s" using {control down, command down} end tell end tell
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden