How to save pdf automatically on every 15 minutes
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How to save pdf automatically on every 15 minutes
We are using Linux. We open a pdf using shell command in livecode, we need back up the pdf for every 15 minutes. Is this possible by livecode.
Re: How to save pdf automatically on every 15 minutes
Hi,
I think you have to use a "send in time" message.
Have a look at "send" and "pendingMessages" in LC dictonary.
Something like that:
Best regards
Jean-Marc
I think you have to use a "send in time" message.
Have a look at "send" and "pendingMessages" in LC dictonary.
Something like that:
Code: Select all
on startSavePdfPending
SavePdfPending
end startSavePdfPending
on SavePdfPending
-- Your save command
send "SavePdfPending" to me in 900 seconds
end SavePdfPending
--to stop
on stopSavePdfPending
doStopPending SavePdfPending
end stopSavePdfPending
on doStopPending pMessage
repeat for each line aLine in the pendingmessages
if pMessage is in item 1 of aLine then
cancel item 1 of aLine
end if
end repeat
end doStopPending
Jean-Marc
https://alternatic.ch
Re: How to save pdf automatically on every 15 minutes
Hi,
I understood something, not more. If you don't mind can you explain the code with some example.
If i want to copy a saved pdf (example.pdf) at time 10:00 am to path "~/home/samjith/"
Then how this possible.
Thanks,
Samjith.
I understood something, not more. If you don't mind can you explain the code with some example.
If i want to copy a saved pdf (example.pdf) at time 10:00 am to path "~/home/samjith/"
Then how this possible.
Thanks,
Samjith.
Re: How to save pdf automatically on every 15 minutes
Hi Samjith,
Here is a stack for example. I tested it on OSX but it should work on linux.
It use a pendingmessage called "SavePdfPending" that save the aera of grc "CadrePrint" to a pdf file.
This message is sent every 30 seconds (easier for test)
Fortunately you stop it with a clic on "StopSave".
I see the first page of pdf file is empty but I don't know yet how avoid this but I am sure someone have the answer
Best regards
Jean-Marc
Here is a stack for example. I tested it on OSX but it should work on linux.
It use a pendingmessage called "SavePdfPending" that save the aera of grc "CadrePrint" to a pdf file.
This message is sent every 30 seconds (easier for test)
Fortunately you stop it with a clic on "StopSave".

I see the first page of pdf file is empty but I don't know yet how avoid this but I am sure someone have the answer
Best regards
Jean-Marc
- Attachments
-
- expOneCdTopdfInTime.livecode.zip
- (26.45 KiB) Downloaded 197 times
https://alternatic.ch
Re: How to save pdf automatically on every 15 minutes
Hi Marc,
I dont want to creat a pdf. What my need is that
I open a pdf using shell command
if need to copy pdf to my home directory for every 30 minutes.
If iam working with that pdf for 4 hout, then it will copy to my home directory for 8 times
Thanks
Samjith
I dont want to creat a pdf. What my need is that
I open a pdf using shell command
if need to copy pdf to my home directory for every 30 minutes.
If iam working with that pdf for 4 hout, then it will copy to my home directory for 8 times
Thanks
Samjith
Re: How to save pdf automatically on every 15 minutes
I'm confused. LiveCode can't edit PDF files, so I think you are opening it in another app. Is that correct? f so, you can just use regular file commands to copy the existing file to another location. LiveCode needs to be running in the background to do that.
If you are not editing the pdf in another app, what do you do with it in LiveCode?
Code: Select all
put url "binfile:" & <path to pdf>" into url "binfile:" & <path to copy>"
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: How to save pdf automatically on every 15 minutes
What are the command line (shell) commands you are using to control the pdf?
In LiveCode, you would use something like Jean-Marc's timing script to execute the SavePDFPending handler every interval.
The handler would execute the shell command required to save the pdf in the required location, eg
whatever shell command you need depends on what your 3rd party controller application is.
In LiveCode, you would use something like Jean-Marc's timing script to execute the SavePDFPending handler every interval.
The handler would execute the shell command required to save the pdf in the required location, eg
Code: Select all
on SavePDFPending
get shell("/user/bin/thePDFexecutable ~/home/samjith/")
end SavePDFPending