Skip to main content
clarified
Source Link
jan
  • 798
  • 2
  • 12
  • 29

I have a simple AppleScript that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz).

It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year)(possibly since updating to Mojave last year).

set CleanFiles to "
    s/one/two/g;
    "

set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:"
set theFolder to POSIX path of myFolder

do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanFiles & "'"

There is no error message, it seems to run but doesn't do anything.

What could be wrong?

I have a simple AppleScript that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz).

It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year).

set CleanFiles to "
    s/one/two/g;
    "

set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:"
set theFolder to POSIX path of myFolder

do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanFiles & "'"

There is no error message, it seems to run but doesn't do anything.

What could be wrong?

I have a simple AppleScript that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz).

It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year).

set CleanFiles to "
    s/one/two/g;
    "

set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:"
set theFolder to POSIX path of myFolder

do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanFiles & "'"

There is no error message, it seems to run but doesn't do anything.

What could be wrong?

deleted 18 characters in body; edited tags; edited title
Source Link
anki
  • 11.9k
  • 7
  • 35
  • 71

Running perl shell script from Apple script (Mojave)AppleScript on Mojave

I have a simple apple scriptAppleScript that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz).

It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year).

set CleanFiles to "
    s/one/two/g;
    "

set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:"
set theFolder to POSIX path of myFolder

do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanFiles & "'"

There is no error message, it seems to run but doesn't do anything.

Anybody any idea whatWhat could be wrong?

Running perl shell script from Apple script (Mojave)

I have a simple apple script that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz).

It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year).

set CleanFiles to "
    s/one/two/g;
    "

set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:"
set theFolder to POSIX path of myFolder

do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanFiles & "'"

There is no error message, it seems to run but doesn't do anything.

Anybody any idea what could be wrong?

Running perl shell script from AppleScript on Mojave

I have a simple AppleScript that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz).

It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year).

set CleanFiles to "
    s/one/two/g;
    "

set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:"
set theFolder to POSIX path of myFolder

do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanFiles & "'"

There is no error message, it seems to run but doesn't do anything.

What could be wrong?

fixed an issue
Source Link
jan
  • 798
  • 2
  • 12
  • 29

I have a simple apple script that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz).

It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year).

set CleanFiles to "
    s/one/two/g;
    "

set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:"
set theFolder to POSIX path of myFolder

do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanElanFilesCleanFiles & "'"

There is no error message, it seems to run but doesn't do anything.

Anybody any idea what could be wrong?

I have a simple apple script that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz).

It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year).

set CleanFiles to "
    s/one/two/g;
    "

set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:"
set theFolder to POSIX path of myFolder

do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanElanFiles & "'"

There is no error message, it seems to run but doesn't do anything.

Anybody any idea what could be wrong?

I have a simple apple script that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz).

It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year).

set CleanFiles to "
    s/one/two/g;
    "

set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:"
set theFolder to POSIX path of myFolder

do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanFiles & "'"

There is no error message, it seems to run but doesn't do anything.

Anybody any idea what could be wrong?

Source Link
jan
  • 798
  • 2
  • 12
  • 29
Loading