I need to pass a variable from one script to another. Most posts I’ve found are specific to a complex task. What I need a very simple answer to a very simple task. Here’s my two applescripts
First script includes the following codes that counts the number of files containing specific text and appends the count value “fileCountB” to the file name.
property baseFileNameB : "OpenEndive_0" set targetDir to POSIX file "/Applications/Endive Clients/" tell application "Finder" set fileCountB to count of (files in folder targetDir whose name contains baseFileNameB) end tell
The second script deletes the first script that is named “OpenEndive0” & fileCountB
set newFileNameB to " OpenEndive_0" & fileCountB & ".app" --Delete OpenEndive_0x() after quiting Endive set myFile to "/Applications/Endive Clients/" & newFileNameB try do shell script "rm -rf " & quoted form of myFile end try
How do I pass the value of “fileCountB” to the second script?