Mac OS Terminal Zip Command – Run from Omnis – Network Paths
Is the path in quotes? Any paths that contain spaces must be wrapped in quotes or the spaces need to be escaped with backslashes.
> On Nov 21, 2017, at 10:14 AM, Michael Mantkowski <michaelj@clientrax.com> wrote:
>
> Still one more question has come up.
>
> Backing up the data files from a local drive seems to work fine. However, files residing on a network server are creating a problem.
>
> Do FileOps.$converthfspathtoposixpath(sys(11),lvBackupFiles)
>
> The above command returns: ‘/Volumes/ClienTrax Data/DataFile.df1’
>
> The Zip Command does not like this path. Even trying to use in manually in Terminal it says it cannot be matched.
>
> Can someone tell me how to reference network paths on OS X that work in Terminal?
>
> *********************************************************************
> Michael Mantkowski
> ClienTrax Software
> 1-614-875-2245
> *********************************************************************
>
>
> —–Original Message—–
> From: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] On Behalf Of Michael Mantkowski
> Sent: Monday, November 20, 2017 11:54 AM
> To: ‘OmnisDev List – English’ <omnisdev-en@lists.omnis-dev.com>
> Subject: RE: Mac OS Terminal Zip Command – Run from Omnis
>
> Another question on this…
>
> Does anyone know why Test.df* works in a file path for zipping files but Te*.csv or *.csv does not?
>
> I am trying to get it to zip only selected files in my folder.
>
> *********************************************************************
> Michael Mantkowski
> ClienTrax Software
> 1-614-875-2245
> *********************************************************************
>
>
> —–Original Message—–
> From: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] On Behalf Of Michael Mantkowski
> Sent: Monday, November 20, 2017 9:36 AM
> To: ‘OmnisDev List – English’ <omnisdev-en@lists.omnis-dev.com>
> Subject: RE: Mac OS Terminal Zip Command – Run from Omnis
>
> Good morning…
>
> Kelly put me on to the answer (or at least an answer in case there is more than one.).
>
> This works.
>
> Do FileOps.$converthfspathtoposixpath(lvBackupFiles,lvBackupFiles)
> Do FileOps.$converthfspathtoposixpath(lvBackupZipFile,lvBackupZipFile)
> Calculate lvCommand as con(‘do shell script ‘,kDq,’zip -r
> ‘,kSq,lvBackupZipFile,kSq,’ ‘,kSq,lvBackupFiles,kSq,kDq) ;; Use Built In
> Zip
>
> Do $runapplescript(lvCommand,lvResponse) Returns lvError
>
> The key was the Single Quotes around the paths. Do not escape the spaces, that causes the error again.
>
> *********************************************************************
> Michael Mantkowski
> ClienTrax Software
> 1-614-875-2245
> *********************************************************************
>
>
> —–Original Message—–
> From: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] On Behalf Of Michael Mantkowski
> Sent: Friday, November 17, 2017 4:05 PM
> To: ‘OmnisDev List – English’ <omnisdev-en@lists.omnis-dev.com>
> Subject: Mac OS Terminal Zip Command – Run from Omnis
>
> I can run th efollowing command in OSX Terminal and it will create a Zip file of all the files in the Pictures folder.
>
> Zip -r “Desktop/Omnis 4321/Test.zip” “Desktop/Omnis 4321/Pictures”
>
> However, when I try to do it from Omnis with the below code I get
> lvError=1753 (Script Error). I suspect it has to do with the Quotes. Tried several variations but no luck. Any ideas?
>
> Begin text block
> Text: do shell script ” Zip -r “Desktop/Omnis 4321/Test.zip” “Desktop/Omnis 4321/Pictures”” (Carriage return) End text block Get text block lvText Do
> $runapplescript(lvText,lvReturn) Returns lvError
>
> *********************************************************************
> Michael Mantkowski
> ClienTrax Software
> 1-614-875-2245
> *********************************************************************
>
>
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com