Re: PDF Watermark Issue
Re: PDF Watermark Issue
- Subject: Re: PDF Watermark Issue
- From: Stan Cleveland <email@hidden>
- Date: Mon, 21 May 2018 10:02:56 -0700
On May 21, 2018, at 05:18 AM, Takaaki Naganoya <email@hidden> wrote:
>
> Maybe we can call this python script from AppleScript via “do shell script”
> command.
> Can we call this with suitable parameters?
Hi Takaaki,
Maybe I'm misunderstanding your question and you already know this, but what
follows demonstrates an AS call to simple Python code with concatenated
parameters:
set desiredNum to 2
set desiredMax to 5
do shell script "python2.7 -c 'for i in range(" & desiredMax & "): print \"i
equals " & ¬
desiredNum & "\" if i==" & desiredNum & " else None'"
--> "None
None
i equals 2
None
None"
I'm not a Python expert, but suspect that this method won't work for Python
code that's very much more complicated. Perhaps you could store more complex
code in a Python executable file and call it using "python2.7 -m [module-name]"
as a do shell script command in AS? Am not sure—that's definitely beyond my pay
grade.
Regards,
Stan C.
_______________________________________________
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